Files
MKM/app/Commands/Transmittal/StoreFileCommand.php
2024-08-05 08:04:35 +08:00

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
);
}
}