$id], [ "id" => 'integer' ]); if ($v->fails()) throw new BadRequestException(); $user = User::query()->findOrFail($id); return response($user); } // POST /user public function store(Request $request) { return response("Create user"); } // PUT /user/{id} public function update(Request $request, string $id) { return response("Update user " . $id); } // DELETE /user/{id} public function destroy(string $id) { return response("Destroy user " . $id); } }