refactor
This commit is contained in:
parent
ea48094bc7
commit
b99f7c81dd
1 changed files with 3 additions and 1 deletions
|
|
@ -16,11 +16,13 @@ return [
|
||||||
|
|
||||||
$comments = $file->comments()->isEmpty() == true ? [] : Data::decode($file->comments()->toArray()['comments'], 'yaml');
|
$comments = $file->comments()->isEmpty() == true ? [] : Data::decode($file->comments()->toArray()['comments'], 'yaml');
|
||||||
|
|
||||||
$comments[$data->targetPage][$data->id] = [
|
$newComment = [
|
||||||
'text' => $data->text,
|
'text' => $data->text,
|
||||||
'username' => $user->name()->isNotEmpty() ? (string) $user->name() : (string) $user->email(),
|
'username' => $user->name()->isNotEmpty() ? (string) $user->name() : (string) $user->email(),
|
||||||
'date' => (string) $data->date,
|
'date' => (string) $data->date,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$comments[$data->targetPage][$data->id] = $newComment;
|
||||||
|
|
||||||
|
|
||||||
$newFile = $file->update([
|
$newFile = $file->update([
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue