Category: Laravel

A few weeks ago, the creator of Laravel, Taylor Otwell made a poll asking the framework’s users how they arrange their model files in the app folder. To create a model the default way, you can run this command below in the terminal: php artisan make:model Bank This command will create a new Bank model class and put the file directly in the app folder.

The ModelMakeClass becomes: The final thing to add to the new command class we just created is the logic to make our folder the default folder to put model files, in my case the Models folder. Our new command class now becomes: Finally, running the artisan command to create a new model will put the models in the app\Models folder by default 🙂.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners