DashboardController::index()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Http\Requests\DatabaseRequest;
6
use App\Services\DatabaseService;
7
use Illuminate\Http\RedirectResponse;
8
use Inertia\Inertia;
9
use Inertia\Response;
10
11
class DashboardController extends Controller
12
{
13
    public function __construct(private DatabaseService $service) {}
14
15
    public function index(): Response
16
    {
17
        $databases = $this->service->index();
18
19
        return Inertia::render('Dashboard', [
20
            'databases' => $databases,
21
        ]);
22
    }
23
24
    public function store(DatabaseRequest $request): RedirectResponse
25
    {
26
        $result = $this->service->execute($request['databaseSelected']);
27
28
        return back()->with([
29
            'message' => $result,
30
        ]);
31
    }
32
}
33