*/ public function all($keys = null): array { $request = parent::all($keys); $request['page'] = $this->route('page'); $request['post_id'] = $this->route('post_id'); return $request; } public function authorize(): bool { return true; } /** * @return array */ public function rules(): array { return [ 'page' => 'required|integer|min:1', 'post_id' => 'required|integer|min:0', ... $this->commentFilter->validateRules(), ... $this->commentOrder->validateRules() ]; } /** * @return array */ public function attributes(): array { return [ 'page' => 'page number', 'post_id' => 'post id', ]; } public function filters(): ?CommentFilterDTO { return $this->commentFilter->makeFromRequest($this); } public function order(): ?CommentOrderDTO { return $this->commentOrder->makeFromRequest($this); } }