Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rafetirmak's avatar

How to import OOP PHP (7.3) Classes to Laravel

I have OOP PHP (7.3) Classes which performs mathematical and statistical calculations reports the results in tables. What is the best way to import this class to Laravel?

0 likes
3 replies
martinbean's avatar

@rafetirmak Laravel is written in PHP. You can use vanilla PHP classes in a Laravel application just fine so long as you have PSR autoloading set up for your classes.

1 like
rafetirmak's avatar
rafetirmak
OP
Best Answer
Level 1

Creating helper and moving native PHP classes in this customHelper.php file solved my problem.

Step 1: create app/Helpers/CustomHelper.php

Step 2: Put your native class in this custom helper file

Step 3: Call this class in your blade file @php use App\Helpers\CustomFunctions; @endphp

Step 4: {[ CustomFunctions::Functionxxxx () }}

Please or to participate in this conversation.