chore: finalize project updates
This commit is contained in:
+1
-11
@@ -53,19 +53,9 @@ class Comment extends Model
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
// ✅ رابطه پلیمورفیک: نظر میتونه متعلق به محصول، خبر، پست و... باشه
|
||||
// رابطه پلیمورفیک
|
||||
public function commentable(): MorphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
// public function comment()
|
||||
// {
|
||||
// return $this->belongsTo(Comment::class, 'commentable_id');
|
||||
// }
|
||||
//
|
||||
// public function comments()
|
||||
// {
|
||||
// return $this->hasMany(Comment::class, 'commentable_id');
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user