protected $simpleAttributes = ['name', 'id', 'slug'];
protected $with = ['book'];
- protected $textField = 'text';
+ public $textField = 'text';
/**
* Converts this page into a simplified array.
return $this->hasMany(Attachment::class, 'uploaded_to')->orderBy('order', 'asc');
}
+ public function comments() {
+ return $this->hasMany(Comment::class, 'page_id')->orderBy('created_on', 'asc');
+ }
+
/**
* Get the url for this page.
* @param string|bool $path