2024-08-29 03:40:17 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
2024-08-29 23:50:29 +02:00
|
|
|
use App\HasHistory;
|
2024-08-29 11:48:10 +02:00
|
|
|
use App\UuidId;
|
2024-08-29 03:40:17 +02:00
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
|
|
|
|
class User extends Authenticatable
|
|
|
|
{
|
2024-08-30 09:37:24 +02:00
|
|
|
use HasFactory;
|
|
|
|
use Notifiable;
|
|
|
|
use UuidId;
|
|
|
|
use HasHistory;
|
2024-08-29 03:40:17 +02:00
|
|
|
|
2024-08-30 03:31:22 +02:00
|
|
|
public const PHONE_REGEX = '/^\+\d+$/';
|
|
|
|
|
2024-08-29 03:40:17 +02:00
|
|
|
/**
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
*
|
|
|
|
* @var array<int, string>
|
|
|
|
*/
|
|
|
|
protected $fillable = [
|
2024-08-29 10:55:49 +02:00
|
|
|
'last_name',
|
2024-08-29 03:40:17 +02:00
|
|
|
'name',
|
2024-08-29 10:55:49 +02:00
|
|
|
'middle_name',
|
2024-08-29 03:40:17 +02:00
|
|
|
'email',
|
2024-08-29 11:48:10 +02:00
|
|
|
'phone',
|
|
|
|
'password',
|
2024-08-29 03:40:17 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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',
|
2024-08-30 06:16:16 +02:00
|
|
|
'deleted_at' => 'datetime',
|
2024-08-29 03:40:17 +02:00
|
|
|
'password' => 'hashed',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|