'json' ]; /** * 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 ['role' => 'user']; } protected static function boot() { parent::boot(); // TODO: Change the autogenerated stub self::saved(function (User $model) { if ($model->type) { Admin::query()->find($model->id)->syncRoles($model->type); } }); } public function department() { return $this->belongsTo(Department::class)->select(['id', 'name']); } public function bikes() { return $this->hasMany(Bike::class, 'user_id'); } }