@extends('layouts.app') @section('content')
← Back to API Keys

{{ $apiKey->name }}

@if($apiKey->description)

{{ $apiKey->description }}

@endif
@if($apiKey->is_active) Edit
@csrf
@csrf @method('DELETE')
@endif
@if(session('new_api_key'))

Your API Key

{{ session('new_api_key') }}

Important: This is the only time you'll see this key. Please copy it now and store it securely.

@endif

Key Details

Key Preview
{{ $apiKey->key_prefix }}...
Status
@if($apiKey->is_active) @if($apiKey->expires_at && $apiKey->expires_at->isPast()) Expired @else Active @endif @else Revoked @endif
Permissions
@foreach($apiKey->permissions as $permission) {{ $permission }} @endforeach
Created
{{ $apiKey->created_at->format('M d, Y g:i A') }}
@if($apiKey->expires_at)
Expires
{{ $apiKey->expires_at->format('M d, Y g:i A') }}
@endif @if($apiKey->allowed_ips)
IP Whitelist
    @foreach($apiKey->allowed_ips as $ip)
  • {{ $ip }}
  • @endforeach
@endif

Recent Activity

@if($recentLogs->count() > 0)
@foreach($recentLogs as $log) @endforeach
Time Method Path Status Response Time
{{ $log->created_at->format('M d, g:i A') }} {{ $log->method }} {{ $log->path }} {{ $log->response_code }} {{ $log->formatted_response_time }}
@else
No activity recorded yet
@endif

Usage Statistics

Total Requests
{{ number_format($stats['total_requests']) }}
Today
{{ number_format($stats['requests_today']) }}
This Month
{{ number_format($stats['requests_this_month']) }}
@if($stats['avg_response_time'])
Avg Response Time (7d)
{{ round($stats['avg_response_time']) }}ms
@endif
Error Rate (7d)
{{ number_format($stats['error_rate'], 1) }}%

Example Usage

curl -H "Authorization: Bearer {{ $apiKey->key_prefix }}..." \
     -H "Content-Type: application/json" \
     {{ url('/api/v2/accounts') }}

See the API documentation for more examples.

@endsection