Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/WalletTransactions.php
Show All 33 Lines | class WalletTransactions extends Command | ||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
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 || !$wallet->owner()->withTrashed()->withEnvTenant()->first()) { | ||||
return 1; | return 1; | ||||
} | } | ||||
foreach ($wallet->transactions()->orderBy('created_at')->get() 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, | ||||
Show All 22 Lines |