public $searchFactor = 1.2;
- protected $fillable = ['name', 'description', 'priority', 'book_id'];
+ protected $fillable = ['name', 'description', 'priority'];
protected $hidden = ['restricted', 'pivot', 'deleted_at'];
/**
* Get the pages that this chapter contains.
+ *
+ * @return HasMany<Page>
*/
public function pages(string $dir = 'ASC'): HasMany
{
*/
public function getVisiblePages(): Collection
{
- return $this->pages()->visible()
+ return $this->pages()
+ ->scopes('visible')
->orderBy('draft', 'desc')
->orderBy('priority', 'asc')
->get();