add user register/login form and authentication
This commit is contained in:
@ -12,25 +12,36 @@ class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The primary key associated with the users table.
|
||||
* @var string
|
||||
*/
|
||||
protected $primaryKey = 'rz_username';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'rz_username',
|
||||
'full_name',
|
||||
'organisation_unit',
|
||||
'has_admin_privileges',
|
||||
'hashed_password'
|
||||
];
|
||||
|
||||
//Timestamps are disabled.
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
'hashed_password',
|
||||
//'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
@ -38,7 +49,13 @@ class User extends Authenticatable
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
//protected $casts = [
|
||||
// 'email_verified_at' => 'datetime',
|
||||
//];
|
||||
|
||||
//override variable 'password'
|
||||
public function getAuthPassword()
|
||||
{
|
||||
return $this->hashed_password;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user