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] Display migrate and db commands in their namespace #51941

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions src/Illuminate/Database/Console/DbCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
use Symfony\Component\Process\Process;
use UnexpectedValueException;

#[AsCommand(name: 'db')]
#[AsCommand(name: 'db:connect', aliases: ['db'])]
class DbCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'db {connection? : The database connection that should be used}
protected $signature = 'db:connect {connection? : The database connection that should be used}
{--read : Connect to the read connection}
{--write : Connect to the write connection}';

Expand All @@ -27,6 +27,13 @@ class DbCommand extends Command
*/
protected $description = 'Start a new database CLI session';

/**
* The console command name aliases.
*
* @var array
*/
protected $aliases = ['db'];

/**
* Execute the console command.
*
Expand Down
11 changes: 9 additions & 2 deletions src/Illuminate/Database/Console/Migrations/MigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use function Laravel\Prompts\confirm;

#[AsCommand(name: 'migrate')]
#[AsCommand(name: 'migrate:run', aliases: ['migrate'])]
class MigrateCommand extends BaseCommand implements Isolatable
{
use ConfirmableTrait;
Expand All @@ -26,7 +26,7 @@ class MigrateCommand extends BaseCommand implements Isolatable
*
* @var string
*/
protected $signature = 'migrate {--database= : The database connection to use}
protected $signature = 'migrate:run {--database= : The database connection to use}
{--force : Force the operation to run when in production}
{--path=* : The path(s) to the migrations files to be executed}
{--realpath : Indicate any provided migration file paths are pre-resolved absolute paths}
Expand All @@ -44,6 +44,13 @@ class MigrateCommand extends BaseCommand implements Isolatable
*/
protected $description = 'Run the database migrations';

/**
* The console command name aliases.
*
* @var array
*/
protected $aliases = ['migrate'];

/**
* The migrator instance.
*
Expand Down