Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tanmay_das's avatar

Is it possible to create a FormRequest along with the model using php artisan make:model?

Usually, for a resource, I create the model, migration and resourceful controller all at once using php artisan make:model MyModel -mcr

Now I realized for a large application, rather than applying rules directly in the controllers method, I should separate them from the controller and keep a dedicated FormRequest class for each of the resources. But php arisan help make:model doesn't show any option for doing such a thing at the same time. So I have to run php artisan make:request MyRequest separately every time. Could you share some tips so that I could save some time and extra keystrokes?

0 likes
3 replies
topvillas's avatar

Make your own command that runs both built in commands.

Please or to participate in this conversation.