RunMigrationsSolution::getSolutionDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Facade\Ignition\Solutions;
4
5
use Facade\IgnitionContracts\RunnableSolution;
6
use Illuminate\Support\Facades\Artisan;
7
8
class RunMigrationsSolution implements RunnableSolution
9
{
10
    private $customTitle;
11
12
    public function __construct($customTitle = '')
13
    {
14
        $this->customTitle = $customTitle;
15
    }
16
17
    public function getSolutionTitle(): string
18
    {
19
        return $this->customTitle;
20
    }
21
22
    public function getSolutionDescription(): string
23
    {
24
        return 'You might have forgotten to run your migrations. You can run your migrations using `php artisan migrate`.';
25
    }
26
27
    public function getDocumentationLinks(): array
28
    {
29
        return [
30
            'Database: Running Migrations docs' => 'https://laravel.com/docs/master/migrations#running-migrations',
31
        ];
32
    }
33
34
    public function getRunParameters(): array
35
    {
36
        return [];
37
    }
38
39
    public function getSolutionActionDescription(): string
40
    {
41
        return 'Pressing the button below will try to run your migrations.';
42
    }
43
44
    public function getRunButtonText(): string
45
    {
46
        return 'Run migrations';
47
    }
48
49
    public function run(array $parameters = [])
50
    {
51
        Artisan::call('migrate');
52
    }
53
}
54