123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Models;
- use Tymon\JWTAuth\Contracts\JWTSubject;
- use Illuminate\Notifications\Notifiable;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use Illuminate\Foundation\Auth\User as Authenticatable;
- use Illuminate\Database\Eloquent\Model;
- class Admin extends Authenticatable implements JWTSubject # 这里别忘了加
- {
- use SoftDeletes;
- use Notifiable;
- // Rest omitted for brevity
- /**
- * Get the identifier that will be stored in the subject claim of the JWT.
- *
- * @return mixed
- */
- public function getJWTIdentifier()
- {
- return $this->getKey();
- }
- /**
- * Return a key value array, containing any custom claims to be added to the JWT.
- *
- * @return array
- */
- public function getJWTCustomClaims()
- {
- return [];
- }
- // protected $connection='mysql_dwbs';
- protected $table='admins';
- protected $guarded=[];
- protected $hidden=['password','mobile','created_at','deleted_at','updated_at','status'];
- public function role(){
- return $this->belongsTo(Role::class,'role_id');
- }
- }
|