index.blade.php 2.99 KB
@extends('layout.admin', ['title' => 'Форматы недвижимости'])

@section('content')
    <section class="favorites">
        <div class="favorites-top">
            <div class="container">
                <div class="breadcrumbs">
                    <ul class="breadcrumbs__list">
                        <li class="breadcrumbs__item"><a class="breadcrumbs__link" href="{{ route('user.index') }}">Главная</a></li>
                        <li class="breadcrumbs__item"><span class="breadcrumbs__link">Форматы недвижимости </span></li>
                    </ul>
                </div>
                <h1 class="favorites__title title-main">Форматы недвижимости</h1>
            </div>
        </div>
        <div class="favorites-cnt">
            <div class="container">
                <a href="{{ route('admin.formatarea.create') }}" class="btn hero-search__btn btn--main">
                    Создать формат
                </a><br><br>
                <table class="table" style="width: 100%">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>Название формата</th>
                        <th>Дата создания</th>
                        <th>Действия</th>
                    </tr>
                    </thead>
                    <tbody>
                    @if ($formatareas->count())
                        @foreach($formatareas as $formatarea)
                            <tr>
                                <td>{{ $formatarea->id }}</td>
                                <td>{{ $formatarea->name_format }}</td>
                                <td>{{ $formatarea->created_at }}</td>
                                <td> <form action="{{ route('admin.formatarea.destroy', $formatarea) }}" method="POST">
                                        <a  href="{{ route('admin.formatarea.edit', ['formatarea' => $formatarea->id]) }}">
                                            Редактировать
                                        </a> |
                                        @csrf
                                        @method('DELETE')
                                        <input class=" btn-danger" type="submit" value="Удалить">
                                    </form>
                                </td>
                            </tr>
                        @endforeach
                    @else
                        <tr>
                            <td>-</td>
                            <td>-</td>
                            <td>-</td>
                            <td>-</td>
                            <td>-</td>
                        </tr>
                    @endif

                    </tbody>
                </table>
                {{ $formatareas->onEachSide(1)->links('catalogs.paginate') }}
                <div class="favorites__items">

                </div>
            </div>
        </div>
    </section>
@endsection