getKey(); } /** * Return a key value array, containing any custom claims to be added to the JWT. * * @return array */ public function getJWTCustomClaims() { return []; } public function emailVerification(): HasMany { return $this->hasMany(UserEmailVerification::class, 'email', 'email'); } /** * @return HasMany */ public function passwordReset(): HasMany { return $this->hasMany(PasswordReset::class, 'user_id', 'id'); } /** * @return belongsToMany */ public function company(): belongsToMany { return $this->belongsToMany(Company::class, (new Employee())->getTable(), 'user_id', 'company_id'); } // /** // * @return HasMany // */ // public function redemptions(): HasMany // { // return $this->HasMany(VoucherRedemption::class, 'user_id', 'id'); // } /** * @return HasMany */ public function milestoneProgress(): HasMany { return $this->HasMany(MilestoneProgress::class, 'user_id', 'id'); } /** * @return MorphMany */ public function voucherifyEntities(): MorphMany { return $this->morphMany(VoucherEntityMapping::class, 'owner'); } /** * @return HasMany */ public function rewards(): HasMany { return $this->HasMany(UserReward::class, 'user_id', 'id'); } public function hasAttribute(string $key, $value = null): bool { $query = $this->attributesKVP()->where('key', $key); if ($value !== null) { $query->where('value', $value); } return $query->exists(); } public function attributesKVP(): MorphMany { return $this->morphMany(KeyValuePair::class, 'owner'); } }