Model/User.php

mail@pastecode.io avatar
unknown
php
7 months ago
1.0 kB
3
Indexable
Never
class User extends Authenticatable implements JWTSubject
{
    use HasFactory;
    use Notifiable;
    use HasApiTokens;

    protected $table = 'TT_MEMBER';
    public $timestamps = false;
    protected $primaryKey = 'MEMBER_MAIL_ADDRESS';

    /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [
        ...
    ];

    /**
     * The attributes that should be hidden for serialization.
     *
     * @var array<int, string>
     */
    protected $hidden = [
        'PASSWORD',
    ];

    protected $casts = [
        'PASSWORD' => 'hashed',
    ];


    /**
     * The attributes that should be cast.
     *
     * @var array<string, string>
     */

    public function getJWTIdentifier()
    {
        return $this->getKey();
    }

    public function getJWTCustomClaims()
    {
        return [];
    }

    public function getAuthPassword()
    {
        return $this->PASSWORD;
    }
}