From a16e5612f16d9fe809791bd1c3a0fc405bf1f414 Mon Sep 17 00:00:00 2001 From: rats4final Date: Sun, 11 Dec 2022 12:51:27 -0400 Subject: [PATCH] borrar pariente, ajustes en persona --- app/Http/Controllers/PersonaController.php | 6 ++---- app/Http/Requests/StorePersonaRequest.php | 1 - app/Models/Persona.php | 4 ---- .../migrations/2022_09_22_152240_create_personas.php | 2 -- resources/views/admin/Persona/create.blade.php | 6 ------ resources/views/admin/Persona/edit.blade.php | 10 ---------- resources/views/admin/Persona/index.blade.php | 2 -- resources/views/admin/user/create.blade.php | 7 ------- resources/views/admin/user/index.blade.php | 2 -- resources/views/auth/register.blade.php | 8 -------- 10 files changed, 2 insertions(+), 46 deletions(-) diff --git a/app/Http/Controllers/PersonaController.php b/app/Http/Controllers/PersonaController.php index c9df31c..83c4f5e 100644 --- a/app/Http/Controllers/PersonaController.php +++ b/app/Http/Controllers/PersonaController.php @@ -29,9 +29,8 @@ public function index() */ public function create() { - $personas = Persona::get(); $tipos_sangre = TipoSangre::get(); - return view('admin.Persona.create', compact('tipos_sangre','personas')); + return view('admin.Persona.create', compact('tipos_sangre')); } /** @@ -66,9 +65,8 @@ public function show(Persona $persona) */ public function edit(Persona $persona) { - $personas = Persona::get(); $tipos_sangre = TipoSangre::get(); - return view('admin.Persona.edit', compact('tipos_sangre','personas','persona')); + return view('admin.Persona.edit', compact('tipos_sangre','persona')); } /** diff --git a/app/Http/Requests/StorePersonaRequest.php b/app/Http/Requests/StorePersonaRequest.php index ce54957..e97efb6 100644 --- a/app/Http/Requests/StorePersonaRequest.php +++ b/app/Http/Requests/StorePersonaRequest.php @@ -23,7 +23,6 @@ public function rules() 'num_seguro'=> 'nullable', 'donante'=> 'required', 'id_tipo_sangre'=> 'required', - 'id_pariente'=>'required' ]; } } diff --git a/app/Models/Persona.php b/app/Models/Persona.php index f5847ce..9c765ae 100644 --- a/app/Models/Persona.php +++ b/app/Models/Persona.php @@ -30,10 +30,6 @@ public function tipo_sangre(){ return $this->belongsTo(TipoSangre::class,'id_tipo_sangre','id_tipo_sangre'); } - public function pariente(){ - return $this->belongsTo(Persona::class,'id_pariente','id_persona'); - } - public function has_especialidad() { return $this->hasMany(Usario_has_especialidad::class,'id_medico','id_persona'); diff --git a/database/migrations/2022_09_22_152240_create_personas.php b/database/migrations/2022_09_22_152240_create_personas.php index 1810792..d20801c 100644 --- a/database/migrations/2022_09_22_152240_create_personas.php +++ b/database/migrations/2022_09_22_152240_create_personas.php @@ -25,8 +25,6 @@ public function up() $table->date('fecha_nac'); $table->Integer('id_tipo_sangre')->unsigned(); $table->foreign('id_tipo_sangre')->references('id_tipo_sangre')->on('tipos_sangre'); - $table->integer('id_pariente')->unsigned()->nullable(); - $table->foreign('id_pariente')->references('id_persona')->on('personas'); $table->timestamps(); }); } diff --git a/resources/views/admin/Persona/create.blade.php b/resources/views/admin/Persona/create.blade.php index 095a87c..9b98dfa 100644 --- a/resources/views/admin/Persona/create.blade.php +++ b/resources/views/admin/Persona/create.blade.php @@ -25,12 +25,6 @@ @endforeach
-
-


-
-

- @foreach($personas as $persona) - - @endforeach -
-

diff --git a/resources/views/admin/user/index.blade.php b/resources/views/admin/user/index.blade.php index 3b12cda..416940e 100644 --- a/resources/views/admin/user/index.blade.php +++ b/resources/views/admin/user/index.blade.php @@ -25,7 +25,6 @@ # Seguro Es donante Tipo Sangre - Pariente Username Correo Acciones @@ -44,7 +43,6 @@ {{ $usuario->persona->num_seguro }} {{ $usuario->persona->donante }} {{ $usuario->persona->tipo_sangre->nombre_tipo_sangre }} - {{ $usuario->persona->pariente->nombre_per }} {{ $usuario->username }} diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 9523651..65f5c67 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -13,14 +13,6 @@ class="absolute inset-0 bg-gradient-to-r from-blue-300 to-blue-600 shadow-lg tra
-
- - -