123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?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;
- class User extends Authenticatable implements JWTSubject # 这里别忘了加
- {
- use Notifiable;
- use SoftDeletes;
- protected $guarded=[];
-
-
- public function getJWTIdentifier()
- {
- return $this->getKey();
- }
-
- public function getJWTCustomClaims()
- {
- return [];
- }
- protected $table='user';
- public function store(){
- return $this->hasOne(Store::class,'id','store_id');
- }
- }
|