feat: initial commit
This commit is contained in:
20
app/Commands/Transmittal/StoreFileCommand.php
Normal file
20
app/Commands/Transmittal/StoreFileCommand.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user