pridanie atributov pouzivatelovi pre aktivaciu uctu

This commit is contained in:
Andrej
2025-11-04 17:26:31 +01:00
parent 39677d6b5f
commit eb122c41ab
3 changed files with 11 additions and 0 deletions

View File

@@ -25,6 +25,9 @@ class User extends Authenticatable
'email',
'role',
'password',
'active',
'needs_password_change',
'activation_token',
];
/**
@@ -35,6 +38,7 @@ class User extends Authenticatable
protected $hidden = [
'password',
'remember_token',
'activation_token',
];
/**
@@ -47,6 +51,8 @@ class User extends Authenticatable
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'active' => 'boolean',
'needs_password_change' => 'boolean'
];
}

View File

@@ -36,6 +36,8 @@ class UserFactory extends Factory
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
'active' => true,
'needs_password_change' => false,
];
}

View File

@@ -17,6 +17,9 @@ return new class extends Migration
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->boolean('active')->default(false);
$table->boolean('needs_password_change')->default(false);
$table->string('activation_token')->nullable();
$table->rememberToken();
$table->timestamps();
});