/
admini
/
dom
Обзор
Документация
Войти
/
admini
/
dom
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
app/Models/User.php
52 строки
1 KB
pisska
add users
28 окт 2025, 20:58
28 окт 2025, 20:58
6e7de8b
Код
Авторство
О чём код?
<?php namespace App\Models; // use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable { use HasApiTokens, HasFactory, Notifiable; /** * The attributes that are mass assignable. * * @var array<int, string> */ protected $fillable = [ 'full_name', 'phone', 'email', 'login', 'password', 'role' ]; /** * The attributes that should be hidden for serialization. * * @var array<int, string> */ protected $hidden = [ 'password', ]; /** * The attributes that should be cast. * * @var array<string, string> */ public function cards() { return $this->hasMany(Card::class); } public function isAdmin() { return $this->role === 'admin'; } }