43 lines
1.6 KiB
PHP
43 lines
1.6 KiB
PHP
@extends('admin.layout')
|
|
|
|
@section('content')
|
|
<div>
|
|
<h1>Отели</h1>
|
|
|
|
<a href="{{ route('admin.hotels.create') }}" class="btn" style="display: inline-block; margin-bottom: 20px;">Добавить отель</a>
|
|
|
|
@if($hotels->isEmpty())
|
|
<p>Нет отелей.</p>
|
|
@else
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Название</th>
|
|
<th>Адрес</th>
|
|
<th>Телефон</th>
|
|
<th>Действия</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($hotels as $hotel)
|
|
<tr>
|
|
<td>{{ $hotel->name }}</td>
|
|
<td>{{ $hotel->address ?? '-' }}</td>
|
|
<td>{{ $hotel->phone ?? '-' }}</td>
|
|
<td>
|
|
<a href="{{ route('admin.hotels.edit', $hotel) }}" class="btn" style="background: #6c757d; margin-right: 6px;">Редактировать</a>
|
|
<form action="{{ route('admin.hotels.destroy', $hotel) }}" method="POST" style="display: inline;">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="btn" style="background: #aaa;" onclick="return confirm('Удалить отель?')">
|
|
Удалить
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
@endif
|
|
</div>
|
|
@endsection |