X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c429cf78187e80deb63982a282a1c6889f30291a..refs/pull/3039/head:/app/Entities/Models/Chapter.php diff --git a/app/Entities/Models/Chapter.php b/app/Entities/Models/Chapter.php index fd818b703..abf496b44 100644 --- a/app/Entities/Models/Chapter.php +++ b/app/Entities/Models/Chapter.php @@ -2,6 +2,7 @@ namespace BookStack\Entities\Models; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Support\Collection; /** @@ -12,6 +13,8 @@ use Illuminate\Support\Collection; */ class Chapter extends BookChild { + use HasFactory; + public $searchFactor = 1.3; protected $fillable = ['name', 'description', 'priority', 'book_id']; @@ -36,7 +39,7 @@ class Chapter extends BookChild { $parts = [ 'books', - urlencode($this->getAttribute('bookSlug') ?? $this->book->slug), + urlencode($this->book_slug ?? $this->book->slug), 'chapter', urlencode($this->slug), trim($path, '/'),