Files
sam-api/app/Models/User.php

43 lines
1.0 KiB
PHP
Raw Normal View History

2025-07-17 10:05:47 +09:00
<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Sanctum\HasApiTokens;
use App\Traits\UppercaseAttributes;
class User extends Authenticatable
{
use HasApiTokens, Notifiable, TwoFactorAuthenticatable;
protected $table = 'members'; // 테이블 이름 변경
protected $primaryKey = 'mb_id'; // 기본 키 변경
protected $fillable = [
'mb_id', 'mb_pass', 'mb_name', 'mb_phone', 'mb_mail',
'email_verified_at', 'mb_type', 'mb_level', 'last_login',
'reg_date', 'remember_token'
];
protected $hidden = [
'mb_pass', 'remember_token',
];
protected $casts = [
'reg_date' => 'datetime',
];
public function getAuthPassword()
{
return $this->mb_pass; // 기본 비밀번호 필드를 mb_pass로 설정
}
public function getAuthIdentifierName()
{
return 'mb_id'; // 기본 로그인 필드를 mb_id로 변경
}
}