@extends('layouts.app') @section('content')
@foreach ($paymentGateways as $gateway)
@csrf @method('PUT') {{-- Header: Name + Active Switch --}}
{{ ucfirst($gateway->name) }}
is_active) ? 'checked' : '' }} style="cursor: pointer;">
{{-- Gateway Image --}}
{{ ucfirst($gateway->name) }}
{{-- Ensure config is array --}} @php $config = is_array($gateway->config) ? $gateway->config : json_decode($gateway->config, true); @endphp {{-- Dynamic fields based on config --}} @foreach ($config as $key => $value) @if ($key === 'mode') @continue @endif
@error($key)
{{ $message }}
@enderror
@endforeach {{-- Mode field if exists --}} @if (isset($config['mode']))
@error('mode')
{{ $message }}
@enderror
@endif {{-- Submit Button (Always bottom right) --}}
@endforeach
@endsection