*/ public function all($keys = null): array { $request = parent::all($keys); $request['id'] = $this->route('id'); $request['post_id'] = $this->route('post_id'); return $request; } /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { return true; } /** * @return array|string> */ public function rules(): array { return [ ...StoreCommentRequest::rulesDefinition(), 'id' => 'required|integer|exists:comments,id', ]; } }