Files
3dealer/app/Models/User.php
T

67 lines
1.8 KiB
PHP
Raw Normal View History

2026-07-03 13:46:54 +00:00
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Database\Factories\UserFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Lunar\Base\LunarUser as LunarUserInterface;
use Lunar\Base\Traits\LunarUser;
use Modules\Core\Auth\Events\UserCreated;
class User extends Authenticatable implements LunarUserInterface
{
use LunarUser;
/** @use HasFactory<UserFactory> */
use HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
];
/**
* The attributes that should be hidden for serialization. Every
* secret-bearing OTP/pending-email-change field is included here,
* not just remember_token — otp_code_hash and
* pending_email_code_hash are bcrypt hashes rather than the raw
* codes (see Modules\Core\Auth\Services\UserOtpService and
* Modules\Core\Customer\Services\CustomerEmailChangeService), but a
* hash is still not something any serialized response should leak,
* and otp_attempts/pending_email_attempts reveal in-progress guess
* counts.
2026-07-03 13:46:54 +00:00
*
* @var list<string>
*/
protected $hidden = [
'remember_token',
'otp_code_hash',
'otp_expires_at',
'otp_attempts',
'pending_email_code_hash',
'pending_email_expires_at',
'pending_email_attempts',
2026-07-03 13:46:54 +00:00
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'otp_code_hash' => 'hashed',
2026-07-03 13:46:54 +00:00
];
}
}