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