Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
9 | class UpdateRatingGuideAnswer extends FormRequest |
||
10 | { |
||
11 | /** |
||
12 | * Determine if the user is authorized to make this request. |
||
13 | * |
||
14 | * @return bool |
||
1 ignored issue
–
show
|
|||
15 | */ |
||
16 | public function authorize() |
||
17 | { |
||
18 | // originalParameter avoids type hinting that automagically transforms the id into the RatingGuideAnswer object |
||
1 ignored issue
–
show
|
|||
19 | //$answer = RatingGuideAnswer::find($this->route()->originalParameter('ratingGuideAnswer')); |
||
20 | |||
21 | // The id parameter in the route is typehinted to magically become a RatingGuideAnswer object. |
||
22 | $answer = $this->route('ratingGuideAnswer'); |
||
23 | return $answer && $this->user()->can('update', $answer); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Get the validation rules that apply to the request. |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | public function rules() |
||
38 | ]; |
||
39 | } |
||
41 |