DatabaseController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A database() 0 6 1
1
<?php
2
3
namespace Turahe\LaravelInstaller\Controllers;
4
5
use Illuminate\Routing\Controller;
6
use Illuminate\Http\RedirectResponse;
7
use Turahe\LaravelInstaller\Helpers\DatabaseManager;
8
9
/**
10
 * Class DatabaseController.
11
 */
12
class DatabaseController extends Controller
13
{
14
    /**
15
     * @var DatabaseManager
16
     */
17
    private DatabaseManager $databaseManager;
18
19
    /**
20
     * @param DatabaseManager $databaseManager
21
     */
22
    public function __construct(DatabaseManager $databaseManager)
23
    {
24
        $this->databaseManager = $databaseManager;
25
    }
26
27
    /**
28
     * Migrate and seed the database.
29
     *
30
     * @return RedirectResponse
31
     */
32
    public function database(): RedirectResponse
33
    {
34
        $response = $this->databaseManager->migrateAndSeed();
35
36
        return redirect()->route('LaravelInstaller::final')
37
                         ->with(['message' => $response]);
38
    }
39
}
40