Skip to content

Commit 9f75d75

Browse files
committed
feat: update to use Laravel Prompts
1 parent c14b95a commit 9f75d75

File tree

3 files changed

+13
-24
lines changed

3 files changed

+13
-24
lines changed

app/Commands/NewCommand.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,27 @@
66
use LaravelZero\Framework\Contracts\Providers\ComposerContract;
77
use Symfony\Component\Process\Process;
88

9+
use function Laravel\Prompts\info;
10+
use function Laravel\Prompts\text;
11+
912
class NewCommand extends Command
1013
{
1114
private const DEV_BRANCH = 'dev-master';
1215

1316
/** {@inheritdoc} */
14-
protected $signature = 'new {name=laravel-zero} {--dev : Installs the latest "development" release}';
17+
protected $signature = 'new {name? : The name of the application}
18+
{--dev : Install the latest "development" release}';
1519

1620
/** {@inheritdoc} */
1721
protected $description = 'Create a new Laravel Zero application';
1822

1923
public function handle(ComposerContract $composer): void
2024
{
21-
$appPath = $this->argument('name');
25+
$appPath = $this->argument('name') ?: text(label: 'Application name', required: true);
26+
2227
$appName = basename($appPath);
2328

24-
$this->info('Crafting application..');
29+
info('Crafting application...');
2530

2631
$developmentBranch = ($this->option('dev') ? ':'.self::DEV_BRANCH : null);
2732

@@ -31,14 +36,14 @@ public function handle(ComposerContract $composer): void
3136
['--prefer-dist']
3237
);
3338

34-
$this->line('');
39+
info('');
3540

3641
$process = Process::fromShellCommandline(
3742
"php application app:rename {$appName}",
3843
$appPath
3944
)->mustRun();
4045

41-
$this->info($process->getOutput());
46+
info($process->getOutput());
4247

4348
$this->comment('Application ready! Build something amazing.');
4449
}

app/Providers/AppServiceProvider.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,4 @@
66

77
class AppServiceProvider extends ServiceProvider
88
{
9-
/**
10-
* Bootstrap any application services.
11-
*
12-
* @return void
13-
*/
14-
public function boot()
15-
{
16-
//
17-
}
18-
19-
/**
20-
* Register any application services.
21-
*
22-
* @return void
23-
*/
24-
public function register()
25-
{
26-
//
27-
}
289
}

config/commands.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@
5656

5757
'hidden' => [
5858
NunoMaduro\LaravelConsoleSummary\SummaryCommand::class,
59+
Symfony\Component\Console\Command\DumpCompletionCommand::class,
5960
Symfony\Component\Console\Command\HelpCommand::class,
6061
Illuminate\Console\Scheduling\ScheduleRunCommand::class,
62+
Illuminate\Console\Scheduling\ScheduleListCommand::class,
6163
Illuminate\Console\Scheduling\ScheduleFinishCommand::class,
6264
Illuminate\Foundation\Console\VendorPublishCommand::class,
65+
LaravelZero\Framework\Commands\StubPublishCommand::class,
6366
],
6467

6568
/*

0 commit comments

Comments
 (0)