- return $this->hasMany('Oxbow\Chapter');
- }
-
- public function children()
- {
- $pages = $this->pages()->where('chapter_id', '=', 0)->get();
- $chapters = $this->chapters()->get();
- foreach($chapters as $chapter) {
- $pages->push($chapter);
- }
- return $pages->sortBy('priority');