Files
ismysiteup.online/app/Models/User.php
T

62 lines
1.3 KiB
PHP
Raw Normal View History

2026-01-14 21:46:04 +02:00
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
2026-01-17 13:46:20 +02:00
use Illuminate\Database\Eloquent\Relations\HasMany;
2026-01-14 21:46:04 +02:00
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'password',
2026-01-17 13:46:20 +02:00
'notification_preferences',
2026-01-14 21:46:04 +02:00
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
2026-01-17 13:46:20 +02:00
'notification_preferences' => 'array',
2026-01-14 21:46:04 +02:00
];
}
2026-01-17 13:46:20 +02:00
public function sites(): HasMany
{
return $this->hasMany(Site::class);
}
public function notifications(): HasMany
{
return $this->hasMany(Notification::class);
}
2026-01-14 21:46:04 +02:00
}