1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added comment reply and delete confirmation.

Also fixed local_id bug
Added component helpers
Added global scroll & Highlight helpers
This commit is contained in:
Dan Brown
2017-09-09 15:56:24 +01:00
parent fea5630ea4
commit 41f56e659d
15 changed files with 158 additions and 69 deletions

View File

@ -69,14 +69,15 @@ class Entity extends Ownable
/**
* Get the comments for an entity
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
* @param bool $orderByCreated
* @return MorphMany
*/
public function comments()
public function comments($orderByCreated = true)
{
return $this->morphMany(Comment::class, 'entity')->orderBy('created_at', 'asc');
$query = $this->morphMany(Comment::class, 'entity');
return $orderByCreated ? $query->orderBy('created_at', 'asc') : $query;
}
/**
* Get the related search terms.
* @return \Illuminate\Database\Eloquent\Relations\MorphMany