@extends('admin.layouts.app')
@section('title', 'Edit Service')
@section('content')
<div class="card" style="max-width:700px">
    <div class="card-header">Edit Service</div>
    <form action="{{ route('admin.services.update', $service) }}" method="POST" enctype="multipart/form-data">
        @csrf @method('PUT')
        <div class="form-row">
            <div class="form-group">
                <label>Title</label>
                <input type="text" name="title" class="form-control" value="{{ old('title', $service->title) }}" required>
            </div>
            <div class="form-group">
                <label>Slug</label>
                <input type="text" name="slug" class="form-control" value="{{ old('slug', $service->slug) }}">
            </div>
        </div>
        <div class="form-group">
            <label>Description</label>
            <textarea name="description" class="form-control">{{ old('description', $service->description) }}</textarea>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label>Icon</label>
                <input type="text" name="icon" class="form-control" value="{{ old('icon', $service->icon) }}">
            </div>
            <div class="form-group">
                <label>Order</label>
                <input type="number" name="order" class="form-control" value="{{ old('order', $service->order) }}" min="0">
            </div>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label>Image</label>
                <input type="file" name="image" class="form-control" accept="image/*">
                @if($service->image) <small class="text-muted">Has image</small> @endif
            </div>
            <div class="form-group">
                <label class="checkbox-label" style="margin-top:25px">
                    <input type="checkbox" name="is_active" value="1" {{ $service->is_active ? 'checked' : '' }}> Active
                </label>
            </div>
        </div>
        <button type="submit" class="btn btn-primary">Update Service</button>
    </form>
</div>
@endsection
