Completed
Push — dev ( 122982...5e45c8 )
by Zach
02:18
created

MigrateRefresh::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
rs 9.4285
1
<?php
2
3
namespace Yarak\Commands;
4
5
use Yarak\Console\YarakCommand;
6
use Yarak\DB\Seeders\SeedRunner;
7
8
class MigrateRefresh extends YarakCommand
9
{
10
    /**
11
     * The command signature.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'migrate:refresh
16
                            {--seed : Seed the database after refreshing.}
17
                            {--class=DatabaseSeeder : The name of the seeder class to run.}';
18
19
    /**
20
     * The command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Refresh the database.';
25
26
    /**
27
     * Handle the command.
28
     */
29
    protected function handle()
30
    {
31
        $this->getMigrator($this->getOutput())->refresh();
32
33
        if ($this->option('seed')) {
34
            $seedRunner = new SeedRunner($this->getOutput());
35
36
            $seedRunner->run($this->option('class'));
37
        }
38
    }
39
}
40