Add User avatarUrl helper and harden dashboard billing lookup.
Deploy Ladill QR Plus / deploy (push) Successful in 23s

Fixes dashboard 500 after SSO when layout renders profile avatar.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-06 21:55:13 +00:00
co-authored by Cursor
parent 50403e93f4
commit 9fc9db8a2f
2 changed files with 20 additions and 1 deletions
+13 -1
View File
@@ -8,7 +8,9 @@ use App\Services\Billing\BillingClient;
use App\Services\Qr\QrCodeManagerService;
use App\Support\Qr\QrTypeCatalog;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use Throwable;
class OverviewController extends Controller
{
@@ -38,12 +40,22 @@ class OverviewController extends Controller
->get()
->sum('scans_30d');
$balanceMinor = 0;
try {
$balanceMinor = $this->billing->balanceMinor($user->public_id);
} catch (Throwable $e) {
Log::warning('QR Plus dashboard could not load wallet balance', [
'user' => $user->public_id,
'error' => $e->getMessage(),
]);
}
return view('qr.dashboard', [
'wallet' => $wallet,
'recentCodes' => $codes,
'activeCount' => $activeCount,
'scans30d' => (int) $scans30d,
'balanceMinor' => $this->billing->balanceMinor($user->public_id),
'balanceMinor' => $balanceMinor,
]);
}
}
+7
View File
@@ -44,4 +44,11 @@ class User extends Authenticatable
['credit_balance' => 0, 'qr_codes_total' => 0, 'scans_total' => 0, 'status' => QrWallet::STATUS_ACTIVE],
);
}
public function avatarUrl(): ?string
{
$url = trim((string) $this->avatar_url);
return $url !== '' ? $url : null;
}
}