Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class StoreJobApplicationAnswer extends FormRequest |
||
12 | { |
||
13 | /** |
||
14 | * Determine if the user is authorized to make this request. |
||
15 | * |
||
16 | * @return bool |
||
17 | */ |
||
18 | public function authorize() |
||
19 | { |
||
20 | $job_application_id = $this->input('job_application_id'); |
||
21 | $application = JobApplication::find($job_application_id); |
||
22 | $user = $this->user(); |
||
23 | |||
24 | return $application !== null |
||
25 | && $user !== null |
||
26 | && $user->can('create', JobApplicationAnswer::class) |
||
27 | && $user->can('update', $application); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * Get the validation rules that apply to the request. |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | public function rules() |
||
41 | ]; |
||
42 | } |
||
44 |