1 | <?php |
||
2 | |||
3 | namespace Uccello\Core\Console\Commands; |
||
4 | |||
5 | use Illuminate\Console\Command; |
||
6 | use Illuminate\Support\Facades\Artisan; |
||
7 | |||
8 | class InstallCommand extends Command |
||
9 | { |
||
10 | /** |
||
11 | * The name and signature of the console command. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $signature = 'uccello:install'; |
||
16 | |||
17 | /** |
||
18 | * The console command description. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $description = 'Install Uccello'; |
||
23 | |||
24 | /** |
||
25 | * The views that need to be exported. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $views = [ |
||
30 | 'auth/login.stub' => 'auth/login.blade.php', |
||
31 | 'auth/register.stub' => 'auth/register.blade.php', |
||
32 | 'auth/passwords/email.stub' => 'auth/passwords/email.blade.php', |
||
33 | 'auth/passwords/reset.stub' => 'auth/passwords/reset.blade.php', |
||
34 | 'layouts/uccello.stub' => 'layouts/uccello.blade.php', |
||
35 | ]; |
||
36 | |||
37 | /** |
||
38 | * Create a new command instance. |
||
39 | * |
||
40 | * @return void |
||
41 | */ |
||
42 | public function __construct() |
||
43 | { |
||
44 | parent::__construct(); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Execute the console command. |
||
49 | * |
||
50 | * @return mixed |
||
51 | */ |
||
52 | public function handle() |
||
53 | { |
||
54 | $this->comment('Executing make:auth...'); |
||
55 | $this->callSilent('make:auth', ['--force' => true]); |
||
56 | |||
57 | $this->comment('Publishing Uccello Assets...'); |
||
58 | $this->callSilent('vendor:publish', ['--tag' => 'uccello-assets']); |
||
59 | |||
60 | $this->comment('Publishing Uccello Configuration...'); |
||
61 | $this->callSilent('vendor:publish', ['--tag' => 'uccello-config']); |
||
62 | |||
63 | |||
64 | $this->comment('Copying User Model...'); |
||
65 | copy( |
||
66 | __DIR__.'/stubs/make/app/User.stub', |
||
67 | app_path('User.php') |
||
68 | ); |
||
69 | |||
70 | $this->comment('Copying Login Controller...'); |
||
71 | copy( |
||
72 | __DIR__.'/stubs/make/app/Http/Controllers/Auth/LoginController.stub', |
||
73 | app_path('Http/Controllers/Auth/LoginController.php') |
||
74 | ); |
||
75 | |||
76 | $this->comment('Copying Views...'); |
||
77 | foreach ($this->views as $key => $value) { |
||
78 | copy( |
||
79 | __DIR__.'/stubs/make/views/'.$key, |
||
80 | resource_path('views/'.$value) |
||
81 | ); |
||
82 | } |
||
83 | |||
84 | $this->info(trans('Uccello scaffolding installed successfully')); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
85 | } |
||
86 | } |