| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class UpdateRequest extends FormRequest |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Determine if the user is authorized to make this request. |
||
| 13 | * |
||
| 14 | * @param \FaithGen\Gallery\Services\AlbumService $albumService |
||
| 15 | * |
||
| 16 | * @return bool |
||
| 17 | */ |
||
| 18 | public function authorize(AlbumService $albumService) |
||
| 19 | { |
||
| 20 | return $this->user()->can('update', $albumService->getAlbum()); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Get the validation rules that apply to the request. |
||
| 25 | * |
||
| 26 | * @return array |
||
| 27 | */ |
||
| 28 | public function rules() |
||
| 29 | { |
||
| 30 | return [ |
||
| 31 | 'name' => 'required|string', |
||
| 32 | 'description' => 'required|string', |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function failedAuthorization() |
||
| 39 | } |
||
| 40 | } |
||
| 41 |