|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Cortex\Tenants\Console\Commands; |
|
6
|
|
|
|
|
7
|
|
|
use Rinvex\Tenants\Console\Commands\PublishCommand as BasePublishCommand; |
|
8
|
|
|
|
|
9
|
|
|
class PublishCommand extends BasePublishCommand |
|
10
|
|
|
{ |
|
11
|
|
|
/** |
|
12
|
|
|
* The name and signature of the console command. |
|
13
|
|
|
* |
|
14
|
|
|
* @var string |
|
15
|
|
|
*/ |
|
16
|
|
|
protected $signature = 'cortex:publish:tenants {--force : Overwrite any existing files.} {--R|resource=all}'; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* The console command description. |
|
20
|
|
|
* |
|
21
|
|
|
* @var string |
|
22
|
|
|
*/ |
|
23
|
|
|
protected $description = 'Publish Cortex Tenants Resources.'; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Execute the console command. |
|
27
|
|
|
* |
|
28
|
|
|
* @return void |
|
29
|
|
|
*/ |
|
30
|
|
|
public function handle(): void |
|
31
|
|
|
{ |
|
32
|
|
|
parent::handle(); |
|
33
|
|
|
|
|
34
|
|
|
switch ($this->option('resource')) { |
|
35
|
|
|
case 'lang': |
|
36
|
|
|
$this->call('vendor:publish', ['--tag' => 'cortex-tenants-lang', '--force' => $this->option('force')]); |
|
37
|
|
|
break; |
|
38
|
|
|
case 'views': |
|
39
|
|
|
$this->call('vendor:publish', ['--tag' => 'cortex-tenants-views', '--force' => $this->option('force')]); |
|
40
|
|
|
break; |
|
41
|
|
|
case 'config': |
|
42
|
|
|
$this->call('vendor:publish', ['--tag' => 'cortex-tenants-config', '--force' => $this->option('force')]); |
|
43
|
|
|
break; |
|
44
|
|
|
case 'migrations': |
|
45
|
|
|
$this->call('vendor:publish', ['--tag' => 'cortex-tenants-migrations', '--force' => $this->option('force')]); |
|
46
|
|
|
break; |
|
47
|
|
|
default: |
|
48
|
|
|
$this->call('vendor:publish', ['--tag' => 'cortex-tenants-lang', '--force' => $this->option('force')]); |
|
49
|
|
|
$this->call('vendor:publish', ['--tag' => 'cortex-tenants-views', '--force' => $this->option('force')]); |
|
50
|
|
|
$this->call('vendor:publish', ['--tag' => 'cortex-tenants-config', '--force' => $this->option('force')]); |
|
51
|
|
|
$this->call('vendor:publish', ['--tag' => 'cortex-tenants-migrations', '--force' => $this->option('force')]); |
|
52
|
|
|
break; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
$this->line(''); |
|
56
|
|
|
} |
|
57
|
|
|
} |
|
58
|
|
|
|