]> BookStack Code Mirror - bookstack/blobdiff - resources/views/entities/list-item.blade.php
Improved relation loading during search
[bookstack] / resources / views / entities / list-item.blade.php
index 8b5eb20b04f81e7d5e8e89b6736b63838c1a49be..c757b0691e3f4ab87a7110d5cf01f539c9ef92d1 100644 (file)
@@ -3,9 +3,9 @@
 <div class="entity-item-snippet">
 
     @if($showPath ?? false)
-        @if($entity->book_id)
+        @if($entity->relationLoaded('book') && $entity->book)
             <span class="text-book">{{ $entity->book->getShortName(42) }}</span>
-            @if($entity->chapter_id)
+            @if($entity->relationLoaded('chapter') && $entity->chapter)
                 <span class="text-muted entity-list-item-path-sep">@icon('chevron-right')</span> <span class="text-chapter">{{ $entity->chapter->getShortName(42) }}</span>
             @endif
         @endif