'datetime', ]; /** * The accessors to append to the model's array form. * * @var array */ protected $appends = [ 'profile_photo_url', ]; public function diaries() { return $this->hasMany(Diary::class); } public function meals() { return $this->hasMany(Meal::class); } public function detailz() { return $this->hasOne(UserDetailz::class); } public function circumference_measures() { return $this->hasMany(CircumferenceMeasure::class); } public function weight_measures() { return $this->hasMany(WeightMeasure::class); } public function consultant_request() { return $this->hasOne(ConsultantEducation::class); } public function attachments() { return $this->hasMany(UserAttachment::class); } protected function consultantState(): Attribute { return Attribute::make( get: fn () => $this->consultant_request ? $this->consultant_request->request_state : 'incomplete', ); } public function author_of_plans() { return $this->belongsToMany(Plan::class, 'plan_author', 'user_id', 'plan_id'); } public function author_of_diets() { return $this->belongsToMany(Diet::class, 'diet_author', 'user_id', 'diet_id'); } public function author_of_blog_post() { return $this->belongsToMany(BlogPost::class, 'blog_post_author', 'user_id', 'blog_post_id'); } public function author_of_recipe() { return $this->belongsToMany(Recipe::class, 'recipe_author', 'user_id', 'recipe_id'); } public function plan_comments() { return $this->hasMany(PlanComment::class); } public function plan_likes(): HasMany { return $this->hasMany(PlanLike::class); } public function diet_comments() { return $this->hasMany(DietComment::class); } public function diet_likes(): HasMany { return $this->hasMany(DietLike::class); } public function comment_upvotes(): HasMany { return $this->hasMany(CommentUpvote::class); } public function diet_comment_upvotes(): HasMany { return $this->hasMany(DietCommentUpvote::class); } public function chosen_plan() { return $this->hasOne(ChoosePlan::class); } public function chosen_diet() { return $this->hasOne(ChosenDiet::class); } public function blog_post_comments() { return $this->hasMany(BlogPostComment::class); } public function blog_post_likes(): HasMany { return $this->hasMany(BlogPostLike::class); } public function blog_post_comment_upvotes(): HasMany { return $this->hasMany(BlogPostCommentUpvote::class); } public function recipe_comments() { return $this->hasMany(RecipeComment::class); } public function recipe_likes(): HasMany { return $this->hasMany(RecipeLike::class); } public function recipe_comment_upvotes(): HasMany { return $this->hasMany(RecipeCommentUpvote::class); } }