Page MenuHomePhorge

SetBalanceCommand.php
No OneTemporary

Size
800 B
Referenced Files
None
Subscribers
None

SetBalanceCommand.php

<?php
namespace App\Console\Commands\Wallet;
use App\Console\Command;
class SetBalanceCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'wallet:set-balance {wallet} {balance}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Set the balance of a wallet';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$wallet = $this->getWallet($this->argument('wallet'));
if (!$wallet) {
$this->error("Wallet not found.");
return 1;
}
$wallet->balance = (int) $this->argument('balance');
$wallet->save();
}
}

File Metadata

Mime Type
text/x-php
Expires
Thu, Nov 20, 10:48 PM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
387327
Default Alt Text
SetBalanceCommand.php (800 B)

Event Timeline