Laravel is full of little tricks, and quick ways to generate code with Artisan. One of the recent ones I've found is when you're creating a CRUD record and need to create Model + Controller. You don't need two separate commands for that.
How I was doing it until now:
php artisan make:model Customer
php artisan make:controller CustomersController --resource
Apparently, there's a quicker way:
php artisan make:controller CustomersController --model=Customer
And that's it. Laravel will actually ask you if you want to generate the model:
But that's not everything! You can create more. All available options you can check by writing php artisan make:controller --help
That's it, quick tip to perform quick operation!
No comments or questions yet...