@extends('layouts.dash')
@section('title', 'Dashboard')
@section('content')
@php
$pctUsed = $stats['quota']>0 ? min(100, round($stats['used']/$stats['quota']*100)) : 0;
$isLow = $stats['left'] < 100 && $stats['left']>0;
$isEmpty = $stats['left'] <= 0 && $stats['quota']>0;
$stepsDone = 0;
$stepsTotal = 3;
if($stats['keys']>0) $stepsDone++;
if($stats['total_hits']>0) $stepsDone++;
if($stats['left']>0) $stepsDone++;
$onboardingPct = round($stepsDone/$stepsTotal*100);
@endphp
Welcome, {{ explode(' ', auth()->user()->name)[0] }} π @if($isLow) Low credits @endif
Hereβs your API health at a glance β {{ number_format($stats['left']) }} credits left β’ {{ number_format($stats['today']) }} today β’ {{ $pctUsed }}% used.
@if(auth()->user()->must_change_password)
@endif
@if($isLow || $isEmpty)
{{ $isEmpty ? 'Out of credits β API calls will fail' : 'Running low β top up to stay live' }}
You have {{ number_format($stats['left']) }} left of {{ number_format($stats['quota']) }}. Buy a package for any API you use most β wallet or secure Auto Payment.
Top Up Now
View orders β
@endif
@foreach($notices as $n)
{{ $n->title }} β {{ \Illuminate\Support\Str::limit($n->message, 220) }}
@endforeach
@if($stepsDone < $stepsTotal)
Get started β {{ $stepsDone }}/{{ $stepsTotal }} done
{{ $onboardingPct }}% β’ Takes < 1 min
1. Claim your keys
{{ $stats['keys']>0 ? $stats['keys'].' keys ready' : 'One per API, free bonus' }}
@if($stats['keys']==0)
Claim @else
Done @endif
2. Make first call
{{ $stats['total_hits']>0 ? number_format($stats['total_hits']).' hits' : 'Copy-paste cURL, run' }}
@if($stats['total_hits']==0)
Try @else
Done @endif
3. Stay topped up
{{ $stats['left']>0 ? number_format($stats['left']).' left' : 'Buy when low' }}
@if($stats['left']==0)
Buy @else
Done @endif
@endif
{{ $stats['keys'] }} API Keys
@if($isEmpty)
Empty @elseif($isLow)
Low @else
Healthy @endif
{{ number_format($stats['left']) }} Credits Left / {{ number_format($stats['quota']) }}
Top up β
{{ $stats['today'] }} today {{ number_format($stats['today']) }} Requests Today
Total: {{ number_format($stats['total_hits']) }} hits
{{ $pctUsed }}% Quota Used
Tap copy, paste into code β one key per API.
@forelse($keys as $k)
@php $pct = $k->usagePercent(); $left=$k->remaining(); @endphp
{{ $k->service->name ?? $k->label }} @if($left<20)Low @endif {!! badge($k->status) !!}
{{ \Illuminate\Support\Str::limit($k->api_key, 22) }}β’β’β’β’ Copy
{{ number_format($left) }} left β’ {{ fmt_date($k->exp_date) }} {{ $pct }}% used
@empty
No keys yet Claim free keys to get started
Claim Keys
@endforelse
Manage All Keys
Latest requests from your keys β refresh to see new ones.
@if($recent->count())
API Param Status Time
@foreach($recent as $l)
{{ $l->service->name ?? 'β' }}
{{ \Illuminate\Support\Str::limit($l->param_summary ?? '', 26) }}
{!! badge($l->status) !!}
{{ $l->created_at->diffForHumans() }}
@endforeach
@else
@endif
@if($firstService)
@php
$myFirst = $keys->first();
$p0 = $firstService->paramList();
$ex = $firstService->gatewayUrl().'?api_key='.($myFirst ? \Illuminate\Support\Str::limit($myFirst->api_key,12).'β¦' : 'YOUR_API_KEY').($p0 ? '&'.$p0[0]['name'].'='.urlencode($p0[0]['placeholder'] ?? '123456') : '');
$fullEx = $firstService->gatewayUrl().'?api_key='.($myFirst ? $myFirst->api_key : 'YOUR_API_KEY').($p0 ? '&'.$p0[0]['name'].'='.urlencode($p0[0]['placeholder'] ?? '123456') : '');
@endphp
Quick Start β {{ $firstService->name }}
{{ $firstService->credits_per_hit }} / hit
Copy, paste & go β no SDK needed. Replace api_key with your key.
GET {{ $ex }}
Copy
@endif
@endsection