feat: updates on expenses

This commit is contained in:
JP
2024-08-21 05:37:35 +08:00
parent 3af7207ec3
commit daa6f692e1
9 changed files with 277 additions and 21 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Commands\Balances;
use App\Commands\Command;
use App\Models\Balance;
use Illuminate\Support\Facades\DB;
class CreateBalanceCommand implements Command
{
public function execute(array $data): mixed
{
return DB::transaction(
callback: fn () => Balance::query()->updateOrCreate([
'id' => $data['id'],
'account_id' => $data['account_id'],
], $data),
attempts: 2
);
}
}