InstallPackage::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 43
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 25
c 1
b 0
f 1
dl 0
loc 43
rs 9.52
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace Mongi\Mongicommerce\Console;
5
6
use Illuminate\Console\Command;
7
use Illuminate\Support\Facades\Artisan;
8
use Mongi\Mongicommerce\Seedeers\SettingsSeeder;
9
use Mongi\Mongicommerce\Seedeers\StasusesOrderSeeder;
10
use Mongi\Mongicommerce\Seedeers\TypesPaymentSeeder;
11
use Mongi\Mongicommerce\Seedeers\UserAdminSeeder;
12
13
class InstallPackage extends Command
14
{
15
    protected $signature = 'mongicommerce:install';
16
17
    protected $description = 'Install mongicommerce';
18
19
    public function handle()
20
    {
21
        $this->alert('Installing Mongicommerce...');
22
23
        $this->info('Installing configuration...');
24
25
        $this->call('vendor:publish', [
26
            '--provider' => "Mongi\Mongicommerce\MongicommerceServiceProvider",
27
            '--tag' => "config"
28
        ]);
29
        $this->info('Installing Admin Template');
30
31
        $this->call('vendor:publish', [
32
            '--provider' => "Mongi\Mongicommerce\MongicommerceServiceProvider",
33
            '--tag' => "assets"
34
        ]);
35
36
        $this->call('vendor:publish', [
37
            '--provider' => "Mongi\Mongicommerce\MongicommerceServiceProvider",
38
            '--tag' => "views"
39
        ]);
40
41
42
        $this->alert('clean tables and installig new tables');
43
        Artisan::call('migrate:fresh');
44
45
46
        $this->info('Installig settings e-commerce');
47
        $this->call(SettingsSeeder::class);
48
49
        $this->info('Installig Statuses');
50
        $this->call(StasusesOrderSeeder::class);
51
52
        $this->info('Installig types Payments');
53
        $this->call(TypesPaymentSeeder::class);
54
    
55
        $this->info('Installig Admins');
56
        $this->call(UserAdminSeeder::class);
57
58
        $this->info('Installig breeze');
59
        Artisan::call('breeze:install');
60
61
        $this->alert('Terminate successfully');
62
    }
63
}
64