forked from eatvio/eatvio-infra
eating plan added
This commit is contained in:
@@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Laravel\Fortify\TwoFactorAuthenticatable;
|
||||
use Laravel\Jetstream\HasProfilePhoto;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
@@ -16,6 +17,9 @@ use App\Models\CircumferenceMeasure;
|
||||
use App\Models\WeightMeasure;
|
||||
use App\Models\ConsultantEducation;
|
||||
use App\Models\UserAttachment;
|
||||
use App\Models\Plan;
|
||||
use App\Models\PlanLike;
|
||||
use App\Models\CommentUpvote;
|
||||
|
||||
class User extends Authenticatable implements MustVerifyEmail
|
||||
{
|
||||
@@ -109,4 +113,24 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
);
|
||||
}
|
||||
|
||||
public function author_of_plans()
|
||||
{
|
||||
return $this->belongsToMany(Plan::class, 'plan_author', 'user_id', 'plan_id');
|
||||
}
|
||||
|
||||
public function plan_comments()
|
||||
{
|
||||
return $this->hasMany(PlanComment::class);
|
||||
}
|
||||
|
||||
public function plan_likes(): HasMany
|
||||
{
|
||||
return $this->hasMany(PlanLike::class);
|
||||
}
|
||||
|
||||
public function comment_upvotes(): HasMany
|
||||
{
|
||||
return $this->hasMany(CommentUpvote::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user