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