update
This commit is contained in:
@@ -5,6 +5,8 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\StoryLike;
|
||||
use App\Models\StoryBookmark;
|
||||
use App\Models\StoryComment;
|
||||
use App\Models\StoryView;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -101,6 +103,16 @@ class Story extends Model
|
||||
return $this->hasMany(StoryLike::class, 'story_id');
|
||||
}
|
||||
|
||||
public function comments(): HasMany
|
||||
{
|
||||
return $this->hasMany(StoryComment::class, 'story_id');
|
||||
}
|
||||
|
||||
public function bookmarks(): HasMany
|
||||
{
|
||||
return $this->hasMany(StoryBookmark::class, 'story_id');
|
||||
}
|
||||
|
||||
// ── Scopes ───────────────────────────────────────────────────────────
|
||||
|
||||
public function scopePublished($query)
|
||||
|
||||
Reference in New Issue
Block a user