| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class UpdateRequest 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 | return $sermonService->getSermon() |
||
| 22 | && $this->user()->can('update', $sermonService->getSermon()); |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Get the validation rules that apply to the request. |
||
| 27 | * |
||
| 28 | * @return array |
||
| 29 | */ |
||
| 30 | public function rules() |
||
| 40 | ]; |
||
| 41 | } |
||
| 42 | |||
| 43 | protected function failedAuthorization() |
||
| 48 |