@extends('layouts.app')
@section('content')
<div class="container-xxl flex-grow-1 container-p-y"><div class="card"><div class="card-header"><h5 class="mb-0">Edit Service Plan</h5></div><div class="card-body">
<form method="POST" action="{{ route('admin.service-plans.update',$servicePlan) }}" class="row g-3">@csrf @method('PUT')
<div class="col-md-6"><label class="form-label">Service</label><select name="service_id" class="form-select" required>@foreach($services as $service)<option value="{{ $service->id }}" @selected($servicePlan->service_id==$service->id)>{{ $service->name }}</option>@endforeach</select></div>
<div class="col-md-6"><label class="form-label">Name</label><input name="name" class="form-control" value="{{ $servicePlan->name }}" required></div>
<div class="col-md-4"><label class="form-label">Price</label><input type="number" step="0.01" name="price" class="form-control" value="{{ $servicePlan->price }}" required></div>
<div class="col-md-4"><label class="form-label">Currency</label><input name="currency" class="form-control" value="{{ $servicePlan->currency }}"></div>
<div class="col-md-4"><label class="form-label">Max Slots</label><input type="number" min="1" name="max_slots" class="form-control" value="{{ $servicePlan->max_slots }}" required></div>
<div class="col-12"><label class="form-label">Features</label><textarea name="features" class="form-control">{{ $servicePlan->features }}</textarea></div>
<div class="col-12 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" @checked($servicePlan->is_active)><label class="form-check-label">Active</label></div>
<div class="col-12 d-flex gap-2"><button class="btn btn-primary">Update</button></form><form method="POST" action="{{ route('admin.service-plans.destroy',$servicePlan) }}">@csrf @method('DELETE')<button class="btn btn-outline-danger">Delete</button></form></div>
</div></div></div>
@endsection
