From 556d6ff01f7e7b92dc33d7670d24db0ca0d4a864 Mon Sep 17 00:00:00 2001 From: Marc15975 <91290441+Marc15975@users.noreply.github.com> Date: Thu, 10 Nov 2022 01:18:52 -0400 Subject: [PATCH] TengoHAMBRE --- app/Http/Controllers/HistorialController.php | 76 +++++++++++++++++++ app/Models/Historial.php | 15 ++++ .../views/admin/Historial/create.blade.php | 39 ++++++++++ .../views/admin/Historial/edit.blade.php | 32 ++++++++ .../views/admin/Historial/index.blade.php | 55 ++++++++++++++ .../views/admin/Historial/show.blade.php | 18 +++++ routes/web.php | 4 +- 7 files changed, 238 insertions(+), 1 deletion(-) create mode 100644 app/Http/Controllers/HistorialController.php create mode 100644 app/Models/Historial.php create mode 100644 resources/views/admin/Historial/create.blade.php create mode 100644 resources/views/admin/Historial/edit.blade.php create mode 100644 resources/views/admin/Historial/index.blade.php create mode 100644 resources/views/admin/Historial/show.blade.php diff --git a/app/Http/Controllers/HistorialController.php b/app/Http/Controllers/HistorialController.php new file mode 100644 index 0000000..86d4677 --- /dev/null +++ b/app/Http/Controllers/HistorialController.php @@ -0,0 +1,76 @@ +except('_token'); + + Historial::create($Datos_Historia); + + return redirect('/Historial'); + } + + + public function show(Historial $Historial) + { + + // $Historia= Historial::find($Historial); + return View ('admin.Historial.show',compact('Historial')); + + } + + + public function edit($historial) + { + // + $Historia= Historial::find($historial); + return View ('admin.Historial.edit',compact('Historia')); + } + + + public function update(Request $request, $historial) + { + // + $input = $request->all(); + + $Historia = Historial::find($historial); + + $Historia->update($input); + + //Redirecionas para no bugear el jalar de datos con reddirect para recargar la vista totalmente + return redirect('/Historial'); + + } + + + public function destroy( $Historial) + { + // + Historial::destroy($Historial); + + // $Historial->delete(); + + return redirect('/Historial'); + } +} diff --git a/app/Models/Historial.php b/app/Models/Historial.php new file mode 100644 index 0000000..66aaa09 --- /dev/null +++ b/app/Models/Historial.php @@ -0,0 +1,15 @@ + + +
Nombre de la Sede : {{ $Historial->id_sede }}
+Nombre del Medico : {{ $Historial->id_medico }}
+Fecha del Historial: {{ $Historial->fecha_historial }}
+Detalles de la Historia: {{ $Historial->detalles_historial }}
+