@extends('admin.layouts.app')
@section('title', 'Edit Payment Method')
@section('content')
<div class="card" style="max-width:700px">
    <div class="card-header">Edit Payment Method</div>
    <form action="{{ route('admin.payment-methods.update', $paymentMethod) }}" method="POST" enctype="multipart/form-data">
        @csrf @method('PUT')
        <div class="form-row">
            <div class="form-group">
                <label>Name *</label>
                <input type="text" name="name" class="form-control" value="{{ old('name', $paymentMethod->name) }}" required>
            </div>
            <div class="form-group">
                <label>Slug</label>
                <input type="text" name="slug" class="form-control" value="{{ old('slug', $paymentMethod->slug) }}" placeholder="Auto-generated if empty">
            </div>
        </div>
        <div class="form-group">
            <label>Description</label>
            <textarea name="description" class="form-control">{{ old('description', $paymentMethod->description) }}</textarea>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label>Logo</label>
                <input type="file" name="logo" class="form-control" accept="image/*">
                @if($paymentMethod->logo) <small class="text-muted">Has logo</small> @endif
            </div>
            <div class="form-group">
                <label>Order</label>
                <input type="number" name="order" class="form-control" value="{{ old('order', $paymentMethod->order) }}" min="0">
            </div>
        </div>
        <div class="form-group">
            <label class="checkbox-label"><input type="checkbox" name="is_active" value="1" {{ $paymentMethod->is_active ? 'checked' : '' }}> Active</label>
        </div>
        <button type="submit" class="btn btn-primary">Update Payment Method</button>
    </form>
</div>
@endsection
