/
denispirit
/
gruzovozoff
Обзор
Документация
Войти
/
denispirit
/
gruzovozoff
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
app/Models/User.php
57 строк
1 KB
denispirit
итоговый проект Грузовозофф
27 фев 2026, 09:30
27 фев 2026, 09:30
377ca07
Код
Авторство
О чём код?
<?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 Illuminate\Database\Eloquent\Relations\HasMany; class User extends Authenticatable { use HasFactory, Notifiable; /** * The attributes that are mass assignable. * * @var array<int, string> */ protected $fillable = [ 'name', 'login', 'email', 'phone', 'password', ]; /** * The attributes that should be hidden for serialization. * * @var array<int, string> */ protected $hidden = [ 'password', ]; /** * Get the attributes that should be cast. * * @return array<string, string> */ protected function casts(): array { return [ 'password' => 'hashed', ]; } /** * Получить все заказы пользователя */ public function orders(): HasMany { return $this->hasMany(Order::class); } }