forge/app/Models/User.php

52 lines
1.1 KiB
PHP
Raw Normal View History

2024-05-13 18:55:34 -04:00
<?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
2024-05-13 18:55:34 -04:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
2024-05-15 00:31:24 -04:00
use Illuminate\Database\Eloquent\Relations\HasMany;
2024-05-13 18:55:34 -04:00
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Jetstream\HasProfilePhoto;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable implements MustVerifyEmail
2024-05-13 18:55:34 -04:00
{
use HasApiTokens;
use HasFactory;
use HasProfilePhoto;
use Notifiable;
use TwoFactorAuthenticatable;
protected $fillable = [
'name',
'email',
'password',
];
protected $hidden = [
'password',
'remember_token',
'two_factor_recovery_codes',
'two_factor_secret',
];
protected $appends = [
'profile_photo_url',
];
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
2024-05-15 00:31:24 -04:00
public function mods(): HasMany
{
return $this->hasMany(Mod::class);
}
2024-05-13 18:55:34 -04:00
}