First Commit (API Project)
This commit is contained in:
10
app/Models/ApiKey.php
Normal file
10
app/Models/ApiKey.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ApiKey extends Model
|
||||
{
|
||||
protected $fillable = ['key', 'description', 'is_active'];
|
||||
}
|
||||
39
app/Models/Member.php
Normal file
39
app/Models/Member.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Fortify\TwoFactorAuthenticatable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class Member extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, Notifiable, TwoFactorAuthenticatable;
|
||||
|
||||
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로 변경
|
||||
}
|
||||
}
|
||||
19
app/Models/SiteAdmin.php
Normal file
19
app/Models/SiteAdmin.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\UppercaseAttributes;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SiteAdmin extends Model
|
||||
{
|
||||
use UppercaseAttributes; // 테이블 컬럼명 대문자 처리
|
||||
|
||||
protected $table = 'SITE_ADMIN';
|
||||
protected $primaryKey = 'UNO';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'UNO', 'LEVEL'. 'COMMENT'
|
||||
];
|
||||
}
|
||||
42
app/Models/User.php
Normal file
42
app/Models/User.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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로 변경
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user