change notifications structure from object to array
This commit is contained in:
parent
0d25794b87
commit
20824983a6
8 changed files with 64 additions and 50 deletions
|
|
@ -26,7 +26,7 @@ return [
|
|||
],
|
||||
'replies' => [],
|
||||
'text' => $data->text,
|
||||
'user' => $user,
|
||||
'author' => $user,
|
||||
'date' => (string) $data->date,
|
||||
'id' => $data->id,
|
||||
'type' => 'comment'
|
||||
|
|
@ -34,13 +34,13 @@ return [
|
|||
|
||||
$newComment = new Comment($data);
|
||||
|
||||
$comments[$newComment->id()] = $newComment->toArray();
|
||||
$comments[] = $newComment->toArray();
|
||||
|
||||
$newFile = $file->update([
|
||||
'comments' => $comments
|
||||
]);
|
||||
|
||||
$user->sendNotification('comments', $newComment);
|
||||
$user->sendNotification($newComment);
|
||||
|
||||
return getFileData($newFile);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue