]> BookStack Code Mirror - bookstack/blobdiff - app/Sorting/SortSet.php
Sorting: Connected up default sort setting for books
[bookstack] / app / Sorting / SortSet.php
index 971b3e29aae243dddfe675da74cbe3c7f0addcc4..a73407bfa08e58e8c695701a34b98e12be034849 100644 (file)
@@ -3,8 +3,10 @@
 namespace BookStack\Sorting;
 
 use BookStack\Activity\Models\Loggable;
+use BookStack\Entities\Models\Book;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\HasMany;
 
 /**
  * @property int $id
@@ -41,4 +43,9 @@ class SortSet extends Model implements Loggable
     {
         return url("/settings/sorting/sets/{$this->id}");
     }
+
+    public function books(): HasMany
+    {
+        return $this->hasMany(Book::class);
+    }
 }