Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/WalletTransactions.php
Show All 37 Lines | class WalletTransactions extends Command | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$wallet = \App\Wallet::where('id', $this->argument('wallet'))->first(); | $wallet = \App\Wallet::where('id', $this->argument('wallet'))->first(); | ||||
if (!$wallet) { | if (!$wallet) { | ||||
return 1; | return 1; | ||||
} | } | ||||
foreach ($wallet->transactions() as $transaction) { | foreach ($wallet->transactions()->orderBy('created_at')->get() as $transaction) { | ||||
$this->info( | $this->info( | ||||
sprintf( | sprintf( | ||||
"%s: %s %s", | "%s: %s %s", | ||||
$transaction->id, | $transaction->id, | ||||
$transaction->created_at, | $transaction->created_at, | ||||
$transaction->toString() | $transaction->toString() | ||||
) | ) | ||||
); | ); | ||||
Show All 19 Lines |