Eager load tags for the bookmark

This commit is contained in:
Annika Backstrom 2024-05-30 20:40:10 +01:00
parent b2dd20a624
commit 2f7f84d896
Signed by: annika
GPG Key ID: 3561F004DE1D9AFE

View File

@ -13,6 +13,8 @@ class Bookmark extends Model
protected $table = 'bookmarks'; protected $table = 'bookmarks';
protected $with = ['tags'];
public function tags(): BelongsToMany public function tags(): BelongsToMany
{ {
return $this->belongsToMany(Tag::class); return $this->belongsToMany(Tag::class);