Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class GetRequest extends FormRequest |
||
11 | { |
||
12 | /** |
||
13 | * Determine if the user is authorized to make this request. |
||
14 | * |
||
15 | * @param \FaithGen\Sermons\SermonService $sermonService |
||
16 | * |
||
17 | * @return bool |
||
18 | */ |
||
19 | public function authorize(SermonService $sermonService) |
||
20 | { |
||
21 | if (auth()->user() instanceof Ministry) { |
||
22 | return $this->user()->can('view', $sermonService->getSermon()); |
||
23 | } |
||
24 | |||
25 | return true; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Get the validation rules that apply to the request. |
||
30 | * |
||
31 | * @return array |
||
32 | */ |
||
33 | public function rules() |
||
34 | { |
||
35 | return []; |
||
36 | } |
||
37 | |||
38 | public function failedAuthorization() |
||
41 | } |
||
42 | } |
||
43 |