AdmineticResetCommand::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 10
c 2
b 0
f 1
nc 1
nop 0
dl 0
loc 12
rs 9.9332
1
<?php
2
3
namespace Pratiksh\Adminetic\Console\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\Artisan;
7
8
class AdmineticResetCommand extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'adminetic:reset';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Admin Panel Reset.';
23
24
    /**
25
     * Create a new command instance.
26
     *
27
     * @return void
28
     */
29
    public function __construct()
30
    {
31
        parent::__construct();
32
    }
33
34
    /**
35
     * Execute the console command.
36
     *
37
     * @return int
38
     */
39
    public function handle()
40
    {
41
        $this->info('Migrating ... ');
42
        Artisan::call('migrate:fresh');
43
        $this->info('Dumping Data ... ');
44
        Artisan::call('adminetic:dummy');
45
        $this->info('Dumping Seeding ... ');
46
        Artisan::call('db:seed');
47
        $this->info('Optimizing ... ');
48
        Artisan::call('view:clear');
49
        Artisan::call('cache:clear');
50
        Artisan::call('optimize');
51
    }
52
}
53