Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2485097
SetBalanceCommand.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
800 B
Referenced Files
None
Subscribers
None
SetBalanceCommand.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment