megahunt.test/app/Models/User.php

59 lines
1.2 KiB
PHP

<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use App\HasHistory;
use App\UuidId;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use HasFactory;
use Notifiable;
use UuidId;
use HasHistory;
public const PHONE_REGEX = '/^\+\d+$/';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'last_name',
'name',
'middle_name',
'email',
'phone',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'deleted_at' => 'datetime',
'password' => 'hashed',
];
}
}