{{-- <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Custom Service List</title>
</head>

<body>
    <h1>Custom Service List</h1>
    <a href="{{ route('custom_service.create') }}">Create New Custom Service</a>

    <table border="1">
        <tr>
            <th>Image</th>
            <th>Text</th>
            <th>Actions</th>
        </tr>
        @foreach ($services as $service)
            <tr>
                <td><img src="{{ asset('img/' . $service->image) }}" width="100"></td>
                <td>{{ $service->text }}</td>
                <td>
                    <a href="{{ route('custom_service.edit', $service->id) }}">Edit</a>
                    <form action="{{ route('custom_service.destroy', $service->id) }}" method="POST"
                        style="display:inline;">
                        @csrf
                        @method('DELETE')
                        <button type="submit">Delete</button>
                    </form>
                </td>
            </tr>
        @endforeach
    </table>
</body>

</html> --}}


@extends('admin.layouts.app')



@section('content')
    @if (session('success'))
        <div id="successAlert" class="alert alert-success fixed-bottom text-white bg-success shadow-lg rounded p-3"
            style="width: 300px; bottom: 10px; right: 10px; position: fixed; z-index: 1050;">
            {{ session('success') }}
        </div>
    @endif

    @if (session('error'))
        <div id="errorAlert" class="alert alert-danger fixed-bottom text-white bg-danger shadow-lg rounded p-3"
            style="width: 300px; bottom: 10px; right: 10px; position: fixed; z-index: 1050;">
            {{ session('error') }}
        </div>
    @endif


    <div class="container">
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-header d-flex justify-content-between align-items-center bg-blue">
                        <h1 class="card-title" style="color:rgb(30, 255, 0);font-size:30px;">Our Custom Service List</h1>
                        <a href="{{ route('custom_service.create') }}" class="btn btn-success  ml-auto">
                            <i class="fas fa-plus"></i> Add New
                        </a>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered table-striped">
                                <thead>
                                    <tr>
                                        <th>Sl</th>
                                        <th>Image</th>
                                        <th>Text</th>
                                        <th>Actions</th>

                                    </tr>
                                </thead>
                                <tbody>
                                    @foreach ($services as $index => $rural)
                                        <tr>
                                            <td>{{ $index + 1 }}</td>
                                            <td>{{ $rural->text }}</td>

                                            <td><img src="{{ asset('img/' . $rural->image) }}" width="100"></td>


                                            <td>
                                                <a href="{{ route('custom_service.edit', $rural->id) }}"
                                                    class="btn btn-warning">Edit</a>
                                                <form action="{{ route('custom_service.destroy', $rural->id) }}"
                                                    method="POST" class="d-inline">
                                                    @csrf
                                                    @method('DELETE')
                                                    <button type="submit" class="btn btn-danger">Delete</button>
                                                </form>
                                            </td>
                                        </tr>
                                    @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
