From 2f7f84d89603c0e9e85fe0fccb415ba0fffbef77 Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Thu, 30 May 2024 20:40:10 +0100 Subject: [PATCH] Eager load tags for the bookmark --- app/Models/Bookmark.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Models/Bookmark.php b/app/Models/Bookmark.php index 6408a88..ebc2078 100644 --- a/app/Models/Bookmark.php +++ b/app/Models/Bookmark.php @@ -13,6 +13,8 @@ class Bookmark extends Model protected $table = 'bookmarks'; + protected $with = ['tags']; + public function tags(): BelongsToMany { return $this->belongsToMany(Tag::class);