20 lines
371 B
PHP
20 lines
371 B
PHP
<?php
|
|
|
|
namespace App\Commands\Transmittal;
|
|
|
|
use App\Commands\Command;
|
|
use App\Models\Comment;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class StoreCommentCommand implements Command
|
|
{
|
|
|
|
public function execute(array $data): mixed
|
|
{
|
|
return DB::transaction(
|
|
callback: fn () => Comment::query()->create($data),
|
|
attempts: 2
|
|
);
|
|
}
|
|
}
|