/home/kueuepay/public_html/resources/views/admin/sections/setup-pages/index.blade.php
@extends('admin.layouts.master')

@push('css')
    <style>
        .switch-toggles{
            margin-left: auto;
        }
    </style>
@endpush

@section('page-title')
    @include('admin.components.page-title',['title' => __($page_title)])
@endsection

@section('breadcrumb')
    @include('admin.components.breadcrumb',['breadcrumbs' => [
        [
            'name'  => __("Dashboard"),
            'url'   => setRoute("admin.dashboard"),
        ]
    ], 'active' => __("Setup Pages")])
@endsection

@section('content')
    <div class="table-area">
        <div class="table-wrapper">
            <div class="table-responsive">
                <table class="custom-table">
                    <thead>
                        <tr>
                            <th>{{ __("Page Name") }}</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        @forelse ($setup_pages as $item)
                            <tr>
                                <td>{{ __($item->title) }}</td>
                                @if ($item->default == false)
                                    <td>
                                        @include('admin.components.form.switcher',[
                                            'name'          => 'status',
                                            'value'         => $item->status,
                                            'options'       => [__('Enable') => 1,__('Disable') => 0],
                                            'onload'        => true,
                                            'data_target'   => $item->slug,
                                            'permission'    => "admin.setup.pages.status.update",
                                        ])
                                    </td>
                                @else
                                <td><span class="badge badge--success">{{ __("Default") }}</span></td>
                                @endif
                            </tr>
                        @empty
                            @include('admin.components.alerts.empty',['colspan' => 2])
                        @endforelse
                    </tbody>
                </table>
            </div>
        </div>
    </div>
@endsection

@push('script')
    <script>
        // Switcher
        switcherAjax("{{ setRoute('admin.setup.pages.status.update') }}");
    </script>
@endpush
Error Handling

Error Handling

In case of an error, the API will return an error response containing a specific error code 400, 403 Failed and a user-friendly message. Refer to our API documentation for a comprehensive list of error codes and their descriptions.