21 lines
547 B
PHP
21 lines
547 B
PHP
<?php
|
|
|
|
namespace App\Modules\History\Actions;
|
|
|
|
use App\Models\User;
|
|
use App\Modules\Client\Models\Client;
|
|
use App\Modules\History\DTOs\HistoryEntryData;
|
|
use App\Modules\History\Models\HistoryEntry;
|
|
|
|
final class CreateHistoryEntryAction
|
|
{
|
|
public function handle(Client $client, HistoryEntryData $data, User $author): HistoryEntry
|
|
{
|
|
return HistoryEntry::create([
|
|
'client_id' => $client->id,
|
|
'type' => $data->type,
|
|
'body' => $data->body,
|
|
'author_id' => $author->id,
|
|
]);
|
|
}
|
|
}
|