-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Expand file tree
/
Copy pathDbOpenCommand.php
More file actions
44 lines (38 loc) · 1.09 KB
/
DbOpenCommand.php
File metadata and controls
44 lines (38 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace Illuminate\Database\Console;
use Illuminate\Console\Command;
use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand(name: 'db:open')]
class DbOpenCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'db:open {connection? : The database connection that should be used}
{--read : Connect to the read connection}
{--write : Connect to the write connection}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Open the database connection in a GUI client';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
// This is an alias for 'db --open'
$arguments = array_filter([
'connection' => $this->argument('connection'),
'--read' => $this->option('read'),
'--write' => $this->option('write'),
'--open' => true,
]);
return $this->call('db', $arguments);
}
}