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 @@ + + +
+
+
Registro de Historias
+
+ +
+ {!! csrf_field() !!} +
+
+
+
+
+
+ +
+
+ +
+
+ + + {{--
+ --}} + +
+
+ +
+
+
+ + diff --git a/resources/views/admin/Historial/edit.blade.php b/resources/views/admin/Historial/edit.blade.php new file mode 100644 index 0000000..75c1bf3 --- /dev/null +++ b/resources/views/admin/Historial/edit.blade.php @@ -0,0 +1,32 @@ + + +
+
Editar Sede
+
+ +
+ {!! csrf_field() !!} + @method("PATCH") + + +
+
+
+
+
+
+ +
+
+ +
+
+ + + +
+
+ +
+
+
diff --git a/resources/views/admin/Historial/index.blade.php b/resources/views/admin/Historial/index.blade.php new file mode 100644 index 0000000..27a5c6c --- /dev/null +++ b/resources/views/admin/Historial/index.blade.php @@ -0,0 +1,55 @@ + + +
+
+
+
+
+

Historias

+
+
+ + Nueva Historia + +
+
+
+ + + + + + + + + + + + @foreach ($Historias as $Historia) + + + + + + + + + + @endforeach + +
PersonaSedeMedicoFecha del HistorialDetalles de la Historia
{{ $Historia['id_persona'] }}{{ $Historia['id_sede'] }}{{ $Historia['id_medico'] }}{{ $Historia['fecha_historial'] }}{{ $Historia['detalles_historial'] }} + +
+ {{ method_field('DELETE') }} + {{ csrf_field() }} + +
+
+
+
+
+
+
+
+ +
diff --git a/resources/views/admin/Historial/show.blade.php b/resources/views/admin/Historial/show.blade.php new file mode 100644 index 0000000..27117f4 --- /dev/null +++ b/resources/views/admin/Historial/show.blade.php @@ -0,0 +1,18 @@ + +
+
Datos de la Historia
+
+ +
+
Nombre de la Persona: {{ $Historial->id_persona }}
+

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 }}

+
+ + + +
+
+
diff --git a/routes/web.php b/routes/web.php index 292b14b..041d6f1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -8,6 +8,7 @@ use App\Http\Controllers\PatologiaController; use App\Http\Controllers\PersonaController; +use App\Http\Controllers\HistorialController; /* |-------------------------------------------------------------------------- | Web Routes @@ -43,3 +44,5 @@ Route::resource('TipoPatologia', TipoPatologiaController::class); Route::resource('Patologia', PatologiaController::class); Route::resource('personas', PersonaController::class); +Route::resource('Historial', HistorialController::class); +