@extends('layouts.cp') @section('title', 'OTP Bypass') @section('content') {{-- Global Bypass Cards --}}
@foreach(['web' => 'Web', 'mobile' => 'Mobile'] as $platform => $platformLabel) @foreach(['dev' => 'Dev', 'prod' => 'Prod'] as $env => $envLabel) @php $key = $platform . '-' . $env; $globalBypass = collect($bypasses->get($key, []))->firstWhere('type', 'global'); @endphp

{{ $platformLabel }} — {{ $envLabel }}

Global bypass

{{ $globalBypass && $globalBypass->is_active ? 'ON' : 'OFF' }}
@csrf
@endforeach @endforeach
{{-- Per User Bypass --}}

Per User Bypass

@csrf
{{-- User bypass list --}} @php $userBypasses = collect($bypasses->flatten())->where('type', 'user'); @endphp @if($userBypasses->isEmpty())

No user bypasses.

@else @foreach($userBypasses as $bypass) @endforeach
User ID Platform Env Status Expires
{{ $bypass->user_id }} {{ $bypass->platform }} {{ $bypass->environment }} {{ $bypass->is_active ? 'Active' : 'Inactive' }} {{ $bypass->expired_at?->format('d M Y H:i') ?? '—' }}
@csrf @method('PATCH')
@csrf @method('DELETE')
@endif
@endsection