Search code examples
laravelterminallaravel-artisan

Unable to Select Multiple Options in php artisan make:model Prompt


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.

terminal

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.


Solution

  • 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

    example on windows terminal

    If you want to reproduce the select menu, use WSL2 instead on windows machine

    example on wsl2