create controller in specific folder laravel code example

Example 1: laravel php artisan make:controller in subfolder

php artisan make:controller subfolder/SomeController

Example 2: php artisan create controller inside folder

php artisan make:controller App\\pathName/controllerName

Example 3: how to create controller in specific folder laravel

php artisan make:controller frontend/HomePageController --resource

Example 4: how to create controller inside folder in laravel

Want to create controller in a folder? use it like this:

php artisan make:controller NameOfFolder/nameOfController

Example 5: laravel controller create command in a folder

However, if you would like to create it in a custom directory then refer to the line below:

php artisan make:controller pathName/controllerName

Tags:

Php Example