-<?php namespace BookStack\Entities\Models;
+<?php
+namespace BookStack\Entities\Models;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Support\Collection;
/**
- * Class Chapter
+ * Class Chapter.
+ *
* @property Collection<Page> $pages
+ * @property mixed description
*/
class Chapter extends BookChild
{
+ use HasFactory;
+
public $searchFactor = 1.3;
protected $fillable = ['name', 'description', 'priority', 'book_id'];
/**
* Get the pages that this chapter contains.
+ *
* @param string $dir
+ *
* @return mixed
*/
public function pages($dir = 'ASC')
{
$parts = [
'books',
- urlencode($this->getAttribute('bookSlug') ?? $this->book->slug),
+ urlencode($this->book_slug ?? $this->book->slug),
'chapter',
urlencode($this->slug),
trim($path, '/'),