A FIELD GUIDE TO LARAVEL · VOLUME II · THE ECOSYSTEM
ENTRY II.29 · CONSOLE TOOLING
Prompts
Laravel\Prompts · Package · first recorded 26 July 2023, v0.1.0 on Packagist
Form controls for the terminal: text, select, search, confirm and the rest, with placeholders, validation and a spinner. Included with Laravel, so an artisan command can ask a question the way a web form does.
Specification
Kind Package, in-process; plain functions, not a facade
Interface Namespaced functions: text(), select(), confirm(), form(), spin()
Runs on macOS, Linux, Windows under WSL; a Symfony fallback elsewhere
Installed by included with Laravel · composer require laravel/prompts elsewhere
Voice none: it is called from inside artisan commands
Scales by scroll on long lists; search() and multisearch() query as you type
Range Cloud: n/a: the Commands tab expects non-interactive commands
Forge, VPS: yes, in an SSH session; the same code
Vapor: defaults only: vapor command adds --no-interaction
Neighbours
Artisan's own ask, confirm and choice methods are the older route and are still documented. Prompts draws the field and validates it, falling back to Symfony's question helper where it cannot run, as on Windows outside WSL. PromptsForMissingInput uses it to ask for missing arguments.
Field marks
use function Laravel\Prompts\text
Prompt::fallbackWhen(...)
->expectsPromptsInfo() in tests
laravel/prompts in composer.lock
Fig. II.29.1 · one question, exploded
Parts
1 Call. text(label: 'Name?', placeholder: '...', required: true, validate: ...) inside a command's handle.
2 Renderer. Draws the prompt, cursor and hint in the terminal and redraws on every keystroke, like a browser input.
3 Transform, then validate. transform runs first, then required, a closure or a rule array such as ['name' => 'unique:users'].
4 Fallback, Symfony's helper, used on Windows outside WSL and in tests. With no TTY, a prompt returns its default.
5 form(). Several prompts in order; submit() returns them and Ctrl+U steps back to fix an earlier answer.
6 spin() and progress(). A spinner round a callback (PCNTL to animate it) and a progress bar that maps over the steps.
Hidden joinery
Labels longer than the terminal width are truncated; the docs suggest 74 characters as a safe maximum. A scroll value shrinks to fit the terminal height, leaving room for a validation message. select() has no required argument because nothing cannot be chosen; validate can still refuse an option. Fallbacks are per prompt class.
Every line checked against the Prompts docs and source, framework, installer and vapor-core, 2026-10-08.
TITLE
Prompts · one question
SOURCES
laravel.com/docs/13.x/prompts · github.com/laravel/prompts/blob/main/src/Prompt.php · github.com/laravel/prompts/blob/main/src/Concerns/Interactivity.php · github.com/laravel/framework/blob/13.x/src/Illuminate/Console/Concerns/ConfiguresPrompts.php · github.com/laravel/framework/blob/13.x/src/Illuminate/Console/Concerns/PromptsForMissingInput.php · github.com/laravel/installer/blob/master/composer.json · github.com/laravel/vapor-core/blob/2.0/src/Runtime/Handlers/CliHandler.php · docs.vapor.build/projects/environments#commands · laravel.com/cloud/docs/environments#commands · laravel.com/forge/docs/knowledge-base/servers · github.com/laravel/prompts · packagist.org/packages/laravel/prompts · laravel.com/docs/13.x/artisan
STATUS
Verified · 2026-10-08
SHEET
II.29 of 48
REV
A · 2026-10-08
DRAWN
BS
FINISH
All faces, including the back