Skip to content

Commit 29a96c6

Browse files
committed
feat: add Laravel Prompts
1 parent fa9e822 commit 29a96c6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"illuminate/support": "^10.13.5",
3535
"illuminate/testing": "^10.13.5",
3636
"laravel-zero/foundation": "^10.12",
37+
"laravel/prompts": "^0.1.6",
3738
"league/flysystem": "^3.15.1",
3839
"nunomaduro/collision": "^6.4.0|^7.8.1",
3940
"nunomaduro/laravel-console-summary": "^1.10.0",

src/Commands/BuildCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
use Symfony\Component\Console\Command\SignalableCommandInterface;
1919
use Symfony\Component\Console\Helper\ProgressBar;
2020
use Symfony\Component\Console\Input\InputInterface;
21-
use Symfony\Component\Console\Output\ConsoleOutputInterface;
2221
use Symfony\Component\Console\Output\NullOutput;
2322
use Symfony\Component\Console\Output\OutputInterface;
2423
use Symfony\Component\Process\Process;
2524
use Throwable;
2625

26+
use function Laravel\Prompts\text;
27+
2728
final class BuildCommand extends Command implements SignalableCommandInterface
2829
{
2930
/**
@@ -174,7 +175,7 @@ private function prepare(): BuildCommand
174175
$config = include $configFile;
175176

176177
$config['env'] = 'production';
177-
$version = $this->option('build-version') ?: $this->ask('Build version?', $config['version']);
178+
$version = $this->option('build-version') ?: text('Build version?', $config['version']);
178179
$config['version'] = $version;
179180

180181
$boxFile = $this->app->basePath('box.json');

src/Commands/RenameCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Illuminate\Support\Facades\File;
1717
use Illuminate\Support\Str;
1818

19+
use function Laravel\Prompts\text;
1920
use function sprintf;
2021

2122
final class RenameCommand extends Command
@@ -66,7 +67,7 @@ private function rename(): RenameCommand
6667
private function asksForApplicationName(): string
6768
{
6869
if (empty($name = $this->input->getArgument('name'))) {
69-
$name = $this->ask('What is your application name?');
70+
$name = text('What is your application name?');
7071
}
7172

7273
if (empty($name)) {

0 commit comments

Comments
 (0)