*/ protected $fillable = [ 'name', 'email', 'password', 'is_public_profile', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', 'two_factor_recovery_codes', 'two_factor_secret', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ]; /** * The accessors to append to the model's array form. * * @var array */ protected $appends = [ 'profile_photo_url', ]; /* public function author_of_blog_post() { return $this->belongsToMany(BlogPost::class, 'blog_post_author'); } public function author_of_plans() { return $this->belongsToMany(Plan::class, 'plan_author'); } public function author_of_diets() { return $this->belongsToMany(Diet::class, 'diet_author'); } public function author_of_recipe() { return $this->belongsToMany(Recipe::class, 'recipe_author'); } */ public function diaries(): HasMany { return $this->hasMany(Diary::class); } public function meals(): HasMany { return $this->hasMany(Meal::class); } public function detailz(): HasOne { return $this->hasOne(UserDetailz::class); } public function circumference_measures(): HasMany { return $this->hasMany(CircumferenceMeasure::class); } public function weight_measures(): HasMany { return $this->hasMany(WeightMeasure::class); } public function consultant_request(): HasOne { return $this->hasOne(ConsultantEducation::class); } public function attachments(): HasMany { return $this->hasMany(UserAttachment::class); } public function author_of_plans(): BelongsToMany { return $this->belongsToMany(Plan::class, 'plan_author', 'user_id', 'plan_id'); } public function author_of_diets(): BelongsToMany { return $this->belongsToMany(Diet::class, 'diet_author', 'user_id', 'diet_id'); } public function author_of_blog_post(): BelongsToMany { return $this->belongsToMany(BlogPost::class, 'blog_post_author', 'user_id', 'blog_post_id'); } public function author_of_recipe(): BelongsToMany { return $this->belongsToMany(Recipe::class, 'recipe_author', 'user_id', 'recipe_id'); } public function plan_comments(): HasMany { return $this->hasMany(PlanComment::class); } public function plan_likes(): HasMany { return $this->hasMany(PlanLike::class); } public function diet_comments(): HasMany { 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(): HasOne { return $this->hasOne(ChosenPlan::class); } public function chosen_diet(): HasOne { return $this->hasOne(ChosenDiet::class); } public function blog_post_comments(): HasMany { 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(): HasMany { 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); } public function consultant_legal_entity(): HasOne { return $this->hasOne(ConsultantLegalEntity::class); } protected function consultantState(): Attribute { return Attribute::make( get: fn () => $this->consultant_request ? $this->consultant_request->request_state : 'incomplete', ); } }