Skip to content

Commit c089bf1

Browse files
nunomaduroStyleCIBottaylorotwell
authored
[11.x] Prompts user to run migrations on install:api Artisan command (#50315)
* Prompts user to run migrations * Apply fixes from StyleCI * Update ApiInstallCommand.php * Update ApiInstallCommand.php --------- Co-authored-by: StyleCI Bot <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
1 parent a3cf850 commit c089bf1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Illuminate/Foundation/Console/ApiInstallCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ public function handle()
4949
$this->uncommentApiRoutesFile();
5050
}
5151

52-
$this->components->info('API scaffolding installed. Please add the "Laravel\Sanctum\HasApiTokens" trait to your User model.');
52+
if ($this->confirm('One new database migration has been published. Would you like to run all pending database migrations?', false)) {
53+
$this->call('migrate');
54+
}
55+
56+
$this->components->info('API scaffolding installed. Please add the [Laravel\Sanctum\HasApiTokens] trait to your User model.');
5357
}
5458

5559
/**

0 commit comments

Comments
 (0)