1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace App\Models;
- use Tymon\JWTAuth\Contracts\JWTSubject;
- use Illuminate\Auth\Authenticatable;
- use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
- use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
- use Illuminate\Database\Eloquent\Model;
- use Laravel\Lumen\Auth\Authorizable;
- class User extends Model implements AuthenticatableContract, AuthorizableContract, JWTSubject
- {
- use Authenticatable, Authorizable;
- protected $table='users';
- protected $hidden = [
- 'password','created_at','updated_at','address'
- ];
- protected $fillable = [
- 'name',
- 'no',
- 'cre_num',
- 'telphone',
- 'team_id',
- 'address',
- 'cert',
- 'openid'
- ];
- public $timestamps = true;
- public function getDateFormat(){
- return time();
- }
- public function getJWTIdentifier()
- {
- return $this->getKey();
- }
- public function getJWTCustomClaims()
- {
- return [];
- }
- // public function getJWTCustomClaims()
- // {
- // return [];
- // }
- }
|