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.

 

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.