Ultima Narrativa
This commit is contained in:
parent
f3fdb42751
commit
2e66fc4309
@ -100,4 +100,15 @@ public function listNarrativas()
|
||||
"data" => $narrativas,
|
||||
]);
|
||||
}
|
||||
public function ultimaNarrativa(Request $request){
|
||||
$request->validate([
|
||||
"id_estandar" => 'required|exists:App\Models\Estandar,id',
|
||||
]);
|
||||
$narrativa = Narrativa::where("id_estandar", $request->id_estandar)->latest()->first();
|
||||
return response([
|
||||
"status" => 1,
|
||||
"message" => "!Ultima Narrativa del estandar ".$request->id_estandar,
|
||||
"data" => $narrativa,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -120,6 +120,7 @@
|
||||
Route::put('narrativa', [NarrativasController::class, 'update']);
|
||||
Route::delete('narrativa/{id}', [NarrativasController::class, 'delete'])->where('id', '[0-9]+');
|
||||
Route::get('narrativa', [NarrativasController::class, 'listNarrativas']);
|
||||
Route::get('narrativa/ultima/{id}', [NarrativasController::class, 'ultimaNarrativa']->where('id', '[0-9]+'));
|
||||
});
|
||||
|
||||
/*Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
||||
|
Loading…
Reference in New Issue
Block a user