Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
ajustes en base de datos
Browse files Browse the repository at this point in the history
  • Loading branch information
rats4final committed Dec 13, 2022
1 parent 3b046ba commit b76281f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
13 changes: 9 additions & 4 deletions app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CreateNewUser implements CreatesNewUsers
public function create(array $input)
{
Validator::make($input, [
//'name' => ['required', 'string', 'max:255'],
'nombre_per' => ['required', 'string', 'max:255'],
'email' => [
'required',
'string',
Expand All @@ -33,13 +33,18 @@ public function create(array $input)
'username' => ['required', 'string', 'max:20'],
'password' => $this->passwordRules(),
])->validate();
//TODO: Terminar esto de las personas

$persona = Persona::create([
'nombre_per' => $input['nombre_per'],
]);

return User::create([
//'name' => $input['name'],
'email' => $input['email'],
'username' => $input['username'],
'password' => Hash::make($input['password']),
'rol' => 1,
'rol' => 2,
'id_persona' => $persona->id_persona
]);

}
}
18 changes: 9 additions & 9 deletions database/migrations/2022_09_22_152240_create_personas.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public function up()
{
Schema::create('personas', function (Blueprint $table) {
$table->Increments('id_persona');
$table->string('nombre_per');
$table->string('apellido_pa_per');
$table->string('apellido_ma_per');
$table->integer('ci_per');
$table->integer('cel_per');
$table->string('num_seguro');
$table->boolean('donante');
$table->date('fecha_nac');
$table->Integer('id_tipo_sangre')->unsigned();
$table->string('nombre_per')->nullable();
$table->string('apellido_pa_per')->nullable();
$table->string('apellido_ma_per')->nullable();
$table->integer('ci_per')->nullable();
$table->integer('cel_per')->nullable();
$table->string('num_seguro')->nullable();
$table->boolean('donante')->nullable();
$table->date('fecha_nac')->nullable();
$table->Integer('id_tipo_sangre')->unsigned()->nullable()->default(1);
$table->foreign('id_tipo_sangre')->references('id_tipo_sangre')->on('tipos_sangre');
$table->timestamps();
});
Expand Down
2 changes: 1 addition & 1 deletion database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DatabaseSeeder extends Seeder
public function run()
{
$this->call([
TipoSangre::class,
TipoSangreSeeder::class,
SedeSeeder::class,
TipoPatologiaSeeder::class,
EspecialidadSeeder::class
Expand Down
7 changes: 7 additions & 0 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ class="absolute inset-0 bg-gradient-to-r from-blue-300 to-blue-600 shadow-lg tra
</div>
<div class="divide-y divide-gray-200">
<div class="py-8 text-base leading-6 space-y-4 text-gray-700 sm:text-lg sm:leading-7">
<div class="relative">
<input id="nombre_per" name="nombre_per" type="text"
class="peer placeholder-transparent h-10 w-full border-b-2 border-gray-300 text-gray-900 focus:outline-none focus:borer-rose-600"
placeholder="Name" />
<label for="nombre_per"
class="absolute left-0 -top-3.5 text-gray-600 text-sm peer-placeholder-shown:text-base peer-placeholder-shown:text-gray-440 peer-placeholder-shown:top-2 transition-all peer-focus:-top-3.5 peer-focus:text-gray-600 peer-focus:text-sm">Nombre</label>
</div>
<div class="relative">
<input id="email" name="email" type="email"
class="peer placeholder-transparent h-10 w-full border-b-2 border-gray-300 text-gray-900 focus:outline-none focus:borer-rose-600"
Expand Down

0 comments on commit b76281f

Please sign in to comment.