From 280ea6bdac69d814689898843ec0d90499acbc41 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 28 Feb 2022 11:21:18 +0800 Subject: [PATCH] fix wallets transaction lists --- app/Http/Resources/CompanyResource.php | 3 ++- routes/web.php | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Resources/CompanyResource.php b/app/Http/Resources/CompanyResource.php index 80ae4a57..b294d600 100644 --- a/app/Http/Resources/CompanyResource.php +++ b/app/Http/Resources/CompanyResource.php @@ -15,6 +15,7 @@ use App\Models\SegmentConstant; use Carbon\Carbon; use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Log; class CompanyResource extends JsonResource { @@ -28,7 +29,7 @@ class CompanyResource extends JsonResource { $lastPayment = $this->transactions()->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->orderBy('id', 'DESC')->first(); $totalPayments = $this->transactions()->where('transactions.type', TransactionType::PAYMENT)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount'); - + Log::info($this->wallets()->first()->code); return [ 'id' => $this->id, 'name' => $this->name, diff --git a/routes/web.php b/routes/web.php index 0f3a98cb..e26ef4d8 100644 --- a/routes/web.php +++ b/routes/web.php @@ -125,7 +125,6 @@ Route::get('/wallet/{marking}/details', function ($marking) { })->name('wallet.details'); Route::get('/wallets', function () { - dd(\App\Models\Company::find(1923)->wallets()->first()); return view('pages.wallet.wallets'); })->name('wallet.wallets');