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

david19's avatar

PHP (App) inside Laravel Package

I created some packages here and there. Can i move some PHP Application inside a Laravel Package? Inside the /src/ Folder? If your answere is yes, i need one Route for the /home ( index.php of the package. I think this is possible…

0 likes
1 reply
LaryAI's avatar
Level 58

Yes, it is possible to move a PHP application inside a Laravel package. You can place the application code inside the src folder of the package. To create a route for the home page of the package, you can add the following code to the routes/web.php file of the package:

Route::get('/home', function () {
    return view('home');
});

You can also create a controller for the home page and add the following code to the routes/web.php file:

Route::get('/home', 'HomeController@index');

Please or to participate in this conversation.