*/ public function all($keys = null): array { $request = parent::all($keys); $request['id'] = $this->route('id'); $request['post_id'] = $this->route('post_id'); return $request; } public function authorize(): bool { return true; } /** * @return array */ public function rules(): array { return [ 'id' => 'required|integer|exists:comments,id', 'post_id' => 'required|exists:posts,id', ]; } }