*/
class Page extends BookChild
{
- protected $fillable = ['name', 'priority', 'markdown'];
+ public static $listAttributes = ['name', 'id', 'slug', 'book_id', 'chapter_id', 'draft', 'template', 'text', 'created_at', 'updated_at', 'priority'];
+ public static $contentAttributes = ['name', 'id', 'slug', 'book_id', 'chapter_id', 'draft', 'template', 'html', 'text', 'created_at', 'updated_at', 'priority'];
- protected $simpleAttributes = ['name', 'id', 'slug'];
+ protected $fillable = ['name', 'priority'];
public $textField = 'text';
return parent::scopeVisible($query);
}
- /**
- * Converts this page into a simplified array.
- *
- * @return mixed
- */
- public function toSimpleArray()
- {
- $array = array_intersect_key($this->toArray(), array_flip($this->simpleAttributes));
- $array['url'] = $this->getUrl();
-
- return $array;
- }
-
/**
* Get the chapter that this page is in, If applicable.
*
{
$parts = [
'books',
- urlencode($this->getAttribute('bookSlug') ?? $this->book->slug),
+ urlencode($this->book_slug ?? $this->book->slug),
$this->draft ? 'draft' : 'page',
$this->draft ? $this->id : urlencode($this->slug),
trim($path, '/'),