{{-- Alerts --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($apis->isEmpty()) {{-- Empty State --}}

No APIs defined yet

Create your first API from a database view.

Create your first API
@else {{-- Stats Bar --}}
@php $statCards = [ ['label' => 'Total', 'value' => $stats['total'], 'bg' => 'bg-purple-50', 'text' => 'text-purple-700', 'border' => 'border-purple-100'], ['label' => 'Published', 'value' => $stats['published'], 'bg' => 'bg-green-50', 'text' => 'text-green-700', 'border' => 'border-green-100'], ['label' => 'Failed', 'value' => $stats['failed'], 'bg' => 'bg-red-50', 'text' => 'text-red-700', 'border' => 'border-red-100'], ['label' => 'Draft', 'value' => $stats['draft'], 'bg' => 'bg-yellow-50', 'text' => 'text-yellow-700', 'border' => 'border-yellow-100'], ['label' => 'Blocked', 'value' => $stats['blocked'], 'bg' => 'bg-orange-50', 'text' => 'text-orange-700', 'border' => 'border-orange-100'], ['label' => 'Revoked', 'value' => $stats['revoked'], 'bg' => 'bg-gray-100', 'text' => 'text-gray-600', 'border' => 'border-gray-200'], ]; @endphp @foreach($statCards as $card)
{{ $card['value'] }}
{{ $card['label'] }}
@endforeach
{{-- Filter Bar --}}
Filter:
@foreach(['all','published','failed','draft','blocked','revoked'] as $f) @endforeach
{{-- Table --}}

API Definitions

{{ $apis->count() }} of {{ $apis->count() }} API{{ $apis->count() !== 1 ? 's' : '' }}

@foreach($apis as $api) @php $isRevoked = !is_null($api->revoked_at); $isBlocked = $api->is_blocked; $isFailed = $api->status === 'failed'; $isPublished = $api->status === 'published'; // Row data attributes for JS filtering $rowStatus = $isRevoked ? 'revoked' : ($isBlocked ? 'blocked' : $api->status); @endphp {{-- Name --}} {{-- Data Source --}} {{-- View --}} {{-- Endpoint --}} {{-- Status --}} {{-- Actions --}} @endforeach
Name Data Source View Endpoint Status Actions

{{ $api->name }}

{{ $api->slug }}

@if($isBlocked) Blocked @endif @if($isRevoked) Revoked @endif
{{ optional($api->dataSource)->name ?? '—' }} {{ $api->dataset_id }} /api/generated/{{ $api->slug }} @php $statusConfig = match(true) { $isRevoked => ['bg-gray-100', 'text-gray-600', 'bg-gray-400', 'Revoked'], $isBlocked => ['bg-orange-100', 'text-orange-700', 'bg-orange-500', 'Blocked'], $isFailed => ['bg-red-100', 'text-red-700', 'bg-red-500', 'Failed'], $isPublished => ['bg-green-100', 'text-green-800', 'bg-green-500', 'Published'], default => ['bg-yellow-100', 'text-yellow-800', 'bg-yellow-500', ucfirst($api->status)], }; @endphp
{{ $statusConfig[3] }} @if($isFailed && $api->last_error)

{{ Str::limit($api->last_error, 60) }}

@endif @if($api->last_checked_at)

Checked: {{ $api->last_checked_at->diffForHumans() }}

@endif
{{-- View --}} View {{-- Publish (show if failed or draft) --}} @if(!$isPublished && !$isRevoked)
@csrf
@endif {{-- Block / Unblock --}} @if(!$isRevoked) @if(!$isBlocked)
@csrf
@else
@csrf
@endif @endif {{-- Revoke --}} @if(!$isRevoked)
@csrf
@endif {{-- Delete --}}
name }}\"?')"> @csrf @method('DELETE')
{{-- No results after filter --}}
@endif