1 | <?php |
||
2 | |||
3 | namespace App\Policies; |
||
4 | |||
5 | use App\Models\Candidate; |
||
6 | use App\Models\User; |
||
7 | use Illuminate\Auth\Access\HandlesAuthorization; |
||
8 | |||
9 | class NotePolicy |
||
10 | { |
||
11 | use HandlesAuthorization; |
||
12 | |||
13 | public function list(User $user) |
||
14 | { |
||
15 | if ($user->can('read all recruitments')) { |
||
16 | return true; |
||
17 | } |
||
18 | |||
19 | $candidate = Candidate::findOrFail(request()->get('candidate_id')); |
||
0 ignored issues
–
show
|
|||
20 | if ($user->can('view', $candidate)) { |
||
21 | return true; |
||
22 | } |
||
23 | |||
24 | return false; |
||
25 | } |
||
26 | |||
27 | public function create(User $user) |
||
28 | { |
||
29 | if ($user->can('read all recruitments')) { |
||
30 | return true; |
||
31 | } |
||
32 | |||
33 | $candidate = Candidate::findOrFail(request()->get('candidate_id')); |
||
34 | if ($user->can('view', $candidate)) { |
||
35 | return true; |
||
36 | } |
||
37 | |||
38 | return false; |
||
39 | } |
||
40 | } |
||
41 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.