Laravel. Models into its own folder

If you create an Eloquent Model in Laravel (v.gr., the “Company” model), using the command

$ php artisan make:model Company

the file is stored in the “App” folder.

If you want to have all the model files into its own folder (v.gr., the “App/Models” folder), you have to create the folder

$ mkdir App/Models

Then you have to indicate all the route in the creation command

$ php artisan make:model Models/Company

Model created successfully.

 

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.