Added comments controller, model, repo, and the database schema. Modified existing Page model to associate with comments.

This commit is contained in:
Abijeet
2017-01-13 21:45:48 +05:30
parent cd6572b61a
commit 397db04428
8 changed files with 143 additions and 2 deletions

View File

@@ -39,6 +39,15 @@ class Page extends Entity
{
return $this->belongsTo(Chapter::class);
}
/**
* Get the comments in the page.
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function comment()
{
return $this->hasMany(Comment::class);
}
/**
* Check if this page has a chapter.