toArray(), array_flip($this->simpleAttributes)); $array['url'] = $this->getUrl(); return $array; } public function book() { return $this->belongsTo('Oxbow\Book'); } public function children() { return $this->hasMany('Oxbow\Page'); } public function parent() { return $this->belongsTo('Oxbow\Page', 'page_id'); } public function getUrl() { return '/books/' . $this->book->slug . '/' . $this->slug; } }