1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-10-25 06:37:36 +03:00

API: Started building comments API endpoints

This commit is contained in:
Dan Brown
2025-10-22 14:58:29 +01:00
parent abe9c1e5a3
commit 082dbc9944
6 changed files with 112 additions and 10 deletions

View File

@@ -240,7 +240,7 @@ abstract class Entity extends Model implements
*/
public function comments(bool $orderByCreated = true): MorphMany
{
$query = $this->morphMany(Comment::class, 'entity');
$query = $this->morphMany(Comment::class, 'commentable');
return $orderByCreated ? $query->orderBy('created_at', 'asc') : $query;
}