json([ 'success' => true, 'data' => $items, 'message' => 'Registros obtenidos correctamente', ], 200); } /** * Store a newly created resource in storage. */ public function store(Request $request): JsonResponse { $payload = $request->only((new EstadoProfesional())->getFillable()); $estadoProfesional = EstadoProfesional::create($payload); return response()->json([ 'success' => true, 'data' => $estadoProfesional, 'message' => 'Registro creado correctamente', ], 201); } /** * Display the specified resource. */ public function show(EstadoProfesional $estadoProfesional): JsonResponse { return response()->json([ 'success' => true, 'data' => $estadoProfesional, 'message' => 'Registro obtenido correctamente', ], 200); } /** * Update the specified resource in storage. */ public function update(Request $request, EstadoProfesional $estadoProfesional): JsonResponse { $payload = $request->only((new EstadoProfesional())->getFillable()); $estadoProfesional->update($payload); return response()->json([ 'success' => true, 'data' => $estadoProfesional, 'message' => 'Registro actualizado correctamente', ], 200); } /** * Remove the specified resource from storage. */ public function destroy(EstadoProfesional $estadoProfesional): JsonResponse { $estadoProfesional->delete(); return response()->json([ 'success' => true, 'message' => 'Registro eliminado correctamente', ], 200); } }