Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Allows to ignoreinstall:api migration prompt #50404

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Illuminate/Foundation/Console/ApiInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class ApiInstallCommand extends Command
protected $signature = 'install:api
{--composer=global : Absolute path to the Composer binary which should be used to install packages}
{--force : Overwrite any existing API routes file}
{--passport : Install Laravel Passport instead of Laravel Sanctum}';
{--passport : Install Laravel Passport instead of Laravel Sanctum}
{--without-migration-prompt : Do not prompt to run pending migrations}';

/**
* The console command description.
Expand Down Expand Up @@ -69,8 +70,10 @@ public function handle()

$this->components->info('API scaffolding installed. Please add the [Laravel\Passport\HasApiTokens] trait to your User model.');
} else {
if ($this->confirm('One new database migration has been published. Would you like to run all pending database migrations?', false)) {
$this->call('migrate');
if (! $this->option('without-migration-prompt')) {
if ($this->confirm('One new database migration has been published. Would you like to run all pending database migrations?', true)) {
$this->call('migrate');
}
}

$this->components->info('API scaffolding installed. Please add the [Laravel\Sanctum\HasApiTokens] trait to your User model.');
Expand Down
Loading