🔄 در حال انجام: تست دستی Filament ⏸️ بلاک: مهاجرت ۳۹۵۰ رکورد (منتظر فایل اکسل اصلاحشده) ⏸️ بلاک: پلاگین وردپرس (بعد از تست کامل API)
58 lines
1.2 KiB
PHP
58 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
class User extends Authenticatable
|
|
{
|
|
/** @use HasFactory<UserFactory> */
|
|
use HasFactory, Notifiable;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'email',
|
|
'password',
|
|
'phone',
|
|
'role',
|
|
'is_active',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'password',
|
|
'remember_token',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'email_verified_at' => 'datetime',
|
|
'password' => 'hashed',
|
|
'is_active' => 'boolean',
|
|
'role' => \App\Enums\UserRole::class,
|
|
];
|
|
}
|
|
|
|
public function isSuperAdmin(): bool
|
|
{
|
|
return $this->role === \App\Enums\UserRole::SuperAdmin;
|
|
}
|
|
|
|
public function isTrackingOperator(): bool
|
|
{
|
|
return $this->role === \App\Enums\UserRole::TrackingOperator;
|
|
}
|
|
|
|
public function isDataEntry(): bool
|
|
{
|
|
return $this->role === \App\Enums\UserRole::DataEntry;
|
|
}
|
|
|
|
public function isCustomer(): bool
|
|
{
|
|
return $this->role === \App\Enums\UserRole::Customer;
|
|
}
|
|
}
|