Conditions | 4 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function index(User $user) |
||
21 | { |
||
22 | $data = []; |
||
23 | if ($user->id) { |
||
24 | //Requesting another user profile |
||
25 | if ( $user->identifiableName() === Auth::user()->id || Auth::user()->can('see-other-users-profile')) { |
||
26 | $data = $user->toArray(); |
||
27 | } else { |
||
28 | abort(403); |
||
29 | } |
||
30 | } |
||
31 | return view('acacha_users::profile', $data); |
||
32 | } |
||
33 | |||
55 | } |