Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Wallet/TransactionsCommand.php
- This file was moved from src/app/Console/Commands/WalletTransactions.php.
<?php | <?php | ||||
namespace App\Console\Commands; | namespace App\Console\Commands\Wallet; | ||||
use App\Console\Command; | use App\Console\Command; | ||||
class WalletTransactions extends Command | class TransactionsCommand extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $signature = 'wallet:transactions {--detail} {wallet}'; | protected $signature = 'wallet:transactions {--detail} {wallet}'; | ||||
Show All 9 Lines | class TransactionsCommand extends Command | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$wallet = $this->getWallet($this->argument('wallet')); | $wallet = $this->getWallet($this->argument('wallet')); | ||||
if (!$wallet) { | if (!$wallet) { | ||||
$this->error("Wallet not found."); | |||||
return 1; | return 1; | ||||
} | } | ||||
$wallet->transactions()->orderBy('created_at')->each(function ($transaction) { | $wallet->transactions()->orderBy('created_at')->each(function ($transaction) { | ||||
$this->info( | $this->info( | ||||
sprintf( | sprintf( | ||||
"%s: %s %s", | "%s: %s %s", | ||||
$transaction->id, | $transaction->id, | ||||
Show All 22 Lines |