2025-11-04 10:19:07 +05:30
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
|
|
|
use Illuminate\Notifications\Notifiable;
|
2025-11-05 15:44:04 +05:30
|
|
|
use PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject;
|
2025-11-04 10:19:07 +05:30
|
|
|
|
2025-11-05 15:44:04 +05:30
|
|
|
class User extends Authenticatable implements JWTSubject
|
2025-11-04 10:19:07 +05:30
|
|
|
{
|
|
|
|
|
use HasFactory, Notifiable;
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'name',
|
|
|
|
|
'email',
|
|
|
|
|
'password',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $hidden = [
|
|
|
|
|
'password',
|
|
|
|
|
'remember_token',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected function casts(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'email_verified_at' => 'datetime',
|
|
|
|
|
'password' => 'hashed',
|
|
|
|
|
];
|
|
|
|
|
}
|
2025-11-05 15:44:04 +05:30
|
|
|
|
|
|
|
|
// 🔑 Required for JWT
|
|
|
|
|
public function getJWTIdentifier()
|
|
|
|
|
{
|
|
|
|
|
return $this->getKey();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getJWTCustomClaims()
|
|
|
|
|
{
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2025-11-04 10:19:07 +05:30
|
|
|
}
|