wilderborn/partyline
Partyline adds lightweight, terminal-style feedback to your Laravel app. It helps you print and update messages, show progress, and display clean, interactive CLI output—handy for Artisan commands, long-running jobs, and scripts.
Start by installing the package via Composer: composer require wilderborn/partyline. In your Artisan command, import the facade (use Wilderborn\Partyline\Facade as Partyline;) and begin prompting interactively. Your first use case is likely replacing manual ask()/confirm() calls—e.g., Partyline::ask('What’s your project name?') returns user input directly. For yes/no prompts, use Partyline::confirm('Proceed with deployment?'). All prompts respect Laravel’s console output buffering and integrate seamlessly with laravel new-style command flows.
$db = Partyline::ask('Database name?', 'myapp');
if (!Partyline::confirm("Create database `$db`?")) return;
choice() with arrays and fallback defaults—Partyline::choice('Environment?', ['local', 'staging', 'production'], 'local') returns the selected value.Partyline::success('✓ Done'), Partyline::warn('⚠ Skipping...'), or Partyline::error('✗ Failed') for consistent feedback. Partyline::setInteractive(false) (e.g., in CI) to auto-answer with defaults or skip prompts gracefully.askDatabaseConfig()) to keep handle() clean.composer.json for required illuminate/console versions.ask() returns the default value only if explicitly passed (e.g., ask('Name?', 'default')); omitting the default yields null. Always validate or fallback after prompts in production scripts.OutputInterface, so avoid mixing with manual output->line() calls unless styled consistently—use Partyline’s styling methods instead.Partyline::fake() in tests to assert prompts and inject responses without user interaction:
Partyline::fake()
->expectPromptedWith('Name?')
->andThenAnswer('MyApp');
confirm() prompts return true/false but don’t echo the result—add explicit feedback via success/warn if needed.$this->secret() (Partyline does not provide secret()).How can I help you explore Laravel packages today?