getKey(); } public function getJWTCustomClaims() { return []; } /** * 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 []; // } public function ContactUs() { return $this->hasOne(ContactUs::class); } public function userThought() { return $this->hasOne(UserThought::class, 'user_id', 'id'); } /** * Created By : Pradyumn Dwivedi * Created at : 06-feb-2023 * Use : To get user details data in user listing */ public function user_detail(){ return $this->hasOne('App\Models\UserDetail', 'user_id', 'id')->withDefault(); } public function leaderboard_master() { return $this->hasMany(LeaderboardMaster::class); } public function stepCount() { return $this->hasMany(DailyStepsCount::class)->where('date', Carbon::today()->toDateString()); } public function latestStepCount() { return $this->hasOne(DailyStepsCount::class)->orderBy('date', 'desc'); } public function getLatestStepCountArrayAttribute() { $latestStepCount = $this->latestStepCount; return $latestStepCount ? [$latestStepCount->toArray()] : []; } }