megahunt.test/app/Models/User.php

59 lines
1.2 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-30 09:37:24 +02:00
use HasFactory;
2024-08-30 09:40:57 +02:00
use HasHistory;
2024-08-30 09:37:24 +02:00
use Notifiable;
use UuidId;
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',
2024-08-30 06:16:16 +02:00
'deleted_at' => 'datetime',
2024-08-29 03:40:17 +02:00
'password' => 'hashed',
];
}
}