Total Complexity | 4 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
10 | class CommentRequest extends FormRequest |
||
11 | { |
||
12 | /** |
||
13 | * Determine if the user is authorized to make this request. |
||
14 | * |
||
15 | * @return bool |
||
16 | */ |
||
17 | public function authorize(MessageService $messageService) |
||
18 | { |
||
19 | return $messageService->getMessage() |
||
20 | && $this->user()->can('view', $messageService->getMessage()); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Get the validation rules that apply to the request. |
||
25 | * |
||
26 | * @return array |
||
27 | */ |
||
28 | public function rules() |
||
33 | ]; |
||
34 | } |
||
35 | |||
36 | public function failedAuthorization() |
||
41 |