2023-03-21 19:54:30 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
use Laravel\Sanctum\HasApiTokens;
|
|
|
|
|
|
|
|
class User extends Authenticatable
|
|
|
|
{
|
|
|
|
use HasApiTokens, HasFactory, Notifiable;
|
|
|
|
|
2023-03-27 15:29:49 +02:00
|
|
|
/**
|
|
|
|
* The primary key associated with the users table.
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $primaryKey = 'rz_username';
|
|
|
|
|
2023-03-21 19:54:30 +01:00
|
|
|
/**
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
*
|
|
|
|
* @var array<int, string>
|
|
|
|
*/
|
|
|
|
protected $fillable = [
|
2023-03-27 15:29:49 +02:00
|
|
|
'rz_username',
|
|
|
|
'full_name',
|
|
|
|
'organisation_unit',
|
|
|
|
'has_admin_privileges',
|
|
|
|
'hashed_password'
|
2023-03-21 19:54:30 +01:00
|
|
|
];
|
|
|
|
|
2023-03-27 15:29:49 +02:00
|
|
|
//Timestamps are disabled.
|
|
|
|
public $timestamps = false;
|
|
|
|
|
2023-03-21 19:54:30 +01:00
|
|
|
/**
|
|
|
|
* The attributes that should be hidden for serialization.
|
|
|
|
*
|
|
|
|
* @var array<int, string>
|
|
|
|
*/
|
|
|
|
protected $hidden = [
|
2023-03-27 15:29:49 +02:00
|
|
|
'hashed_password',
|
|
|
|
//'remember_token',
|
2023-03-21 19:54:30 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes that should be cast.
|
|
|
|
*
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
2023-03-27 15:29:49 +02:00
|
|
|
//protected $casts = [
|
|
|
|
// 'email_verified_at' => 'datetime',
|
|
|
|
//];
|
|
|
|
|
|
|
|
//override variable 'password'
|
|
|
|
public function getAuthPassword()
|
|
|
|
{
|
|
|
|
return $this->hashed_password;
|
|
|
|
}
|
2023-03-21 19:54:30 +01:00
|
|
|
}
|