I’m using Laravel 11. When I run php artisan make:model, I am prompted to give a name and choose additional options (e.g., factory, migration, seeder), but I can’t navigate through them using arrow keys. Instead, I have to type the option name, so it only makes me select one.
I’ve tried using different terminals (Command Prompt, PowerShell, Git Bash) and running it in VSCode’s integrated terminal on Windows, but the issue persists. I should be able to use the arrow keys to navigate and the spacebar to select multiple options, allowing me to generate the model, migration, factory, seeder, etc., all at once.
2
Answers
I’ve never heard of this interactive menu, so I can’t help you with that. In my environment, when I run
php artisan make:model MyModel
, it doesn’t show any menu, it just generates the model.But you can still achieve what you’re looking for using flags.
For instance, if you want to create a Model and a Factory:
or even:
Here are the other options you can use:
--seed
or-s
--factory
or-f
--controller
or-c
--resource
or-r
--requests
or-R
--policy
or-p
--migration
or-m
--pivot
or-p
So even without a menu, you can use these commands to get the desired setup. You can also combine them.
Edit:
I tried running
php artisan make:model
without a model name, and it prompted me for the model name and options. However, there were no arrows, so I had to type the options manually. I can specify multiple options by separating them with commas.The reasons is, laravel prompt not support multi-select in windows cmd, powershell or even in git bash. you can read the full documentation here https://laravel.com/docs/11.x/prompts#fallbacks
If you want to reproduce the select menu, use WSL2 instead on windows machine