megahunt.test/app/Models/User.php

55 lines
1.1 KiB
PHP
Raw Normal View History

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-29 23:50:29 +02:00
use HasFactory, Notifiable, UuidId, 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 = [
'last_name',
2024-08-29 03:40:17 +02:00
'name',
'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',
'password' => 'hashed',
];
}
}