ldc-jeusselin/app/Models/User.php

73 lines
1.7 KiB
PHP

<?php
namespace App\Models;
use App\Enums\UserRoleEnum;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Auth\Notifications\ResetPassword as ResetPasswordNotification;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Hash;
/**
* @property string $hashcode
* @property string $firstname
* @property string $lastname
* @property string $email
* @property string $password
* @property string $password_token
* @property \App\Enums\UserRoleEnum $role
* @property string $remember_token
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
*
* @package App\Models
*/
class User extends Authenticatable
{
use HasFactory;
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'firstname',
'lastname',
'email',
'role'
];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'last_connection' => 'datetime',
'role' => UserRoleEnum::class
];
/**
* The attributes that should be hidden for arrays.
*
* @var array<string>
*/
protected $hidden = [
'remember_token',
'role' => UserRoleEnum::class,
];
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted()
{
// * EVENT CLOSURES.
}
}