Passed
Push — dev6 ( 77ef26...6e2ff7 )
by Ron
16:42
created

InitializeUserController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
3
namespace App\Http\Controllers\User;
4
5
use Inertia\Inertia;
6
use Illuminate\Http\Request;
7
8
use App\Models\User;
9
use App\Models\UserInitialize;
10
use App\Http\Controllers\Controller;
11
12
class InitializeUserController extends Controller
13
{
14
    /**
15
     * Allow a user to finish setting up their profile
16
     */
17
    public function __invoke(Request $request)
18
    {
19
        $link = UserInitialize::where('token', $request->token)->firstOrFail();
20
21
        return Inertia::render('User/Initialize', [
22
            'link' => $link,
23
            'name' => User::where('username', $link->username)->first()->full_name,
24
        ]);
25
    }
26
}
27