Passed
Push — master ( d05062...3d846f )
by Curtis
19:36 queued 12:47
created

Start::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace App\Http\Controllers\enso\Impersonate;
4
5
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
6
use Illuminate\Routing\Controller;
7
use App\Models\User;
8
9
class Start extends Controller
10
{
11
    use AuthorizesRequests;
12
13
    public function __invoke(User $user)
14
    {
15
        // $this->authorize('impersonate', $user);
16
17
        session()->put('impersonating', $user->id);
18
19
        return ['message' => __('Impersonating :user', ['user' => $user->person->name])];
0 ignored issues
show
Bug introduced by
The property name does not seem to exist on App\Person. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
20
    }
21
}
22