mandant-crm/backend/app/Modules/History/Actions/UpdateHistoryEntryAction.php

20 lines
460 B
PHP

<?php
namespace App\Modules\History\Actions;
use App\Models\User;
use App\Modules\History\DTOs\HistoryEntryData;
use App\Modules\History\Models\HistoryEntry;
final class UpdateHistoryEntryAction
{
public function handle(HistoryEntry $entry, HistoryEntryData $data, User $editor): HistoryEntry
{
$entry->update([
'body' => $data->body,
'updated_by' => $editor->id,
]);
return $entry->fresh();
}
}