Completed
Push — master ( efdc7e...8e7c5b )
by Maarten
01:54 queued 12s
created

MigrationsController   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 39
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 1
A rollback() 0 6 1
A seed() 0 6 1
A refresh() 0 8 1
A fresh() 0 6 1
1
<?php
2
3
namespace Mtolhuys\LaravelSchematics\Http\Controllers;
4
5
use Illuminate\Support\Facades\Artisan;
6
use Illuminate\Routing\Controller;
7
8
class MigrationsController extends Controller
9
{
10
    public function run()
11
    {
12
        Artisan::call('migrate');
13
14
        return Artisan::output();
15
    }
16
17
    public function rollback()
18
    {
19
        Artisan::call('migrate:rollback');
20
21
        return Artisan::output();
22
    }
23
24
    public function seed()
25
    {
26
        Artisan::call('db:seed');
27
28
        return Artisan::output();
29
    }
30
31
    public function refresh()
32
    {
33
        Artisan::call('migrate:refresh', [
34
            '--force' => true,
35
        ]);
36
37
        return Artisan::output();
38
    }
39
40
    public function fresh()
41
    {
42
        Artisan::call('migrate:fresh');
43
44
        return Artisan::output();
45
    }
46
}
47