/
ghx
/
TicketFlow
Обзор
Документация
Войти
/
ghx
/
TicketFlow
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
app/Models/User.php
43 строки
974 B
osnov
.
26 июн 2026, 11:56
26 июн 2026, 11:56
dc2de34
Код
Авторство
О чём код?
<?php namespace App\Models; use Database\Factories\UserFactory; use Illuminate\Database\Eloquent\Attributes\Fillable; use Illuminate\Database\Eloquent\Attributes\Hidden; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; #[Fillable(['name', 'email', 'password', 'role'])] #[Hidden(['password', 'remember_token'])] class User extends Authenticatable { /** @use HasFactory<UserFactory> */ use HasFactory, Notifiable; protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } protected $fillable = [ 'name', 'email', 'password', 'role', ]; public function isAdmin(): bool { return $this->role === 'admin'; } public function tickets() { return $this->hasMany(Ticket::class); } }