45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
@extends('admin.layout')
|
|
|
|
@section('content')
|
|
<div>
|
|
<h1>Отели</h1>
|
|
|
|
@if(session('success'))
|
|
<div class="success">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
<a href="{{ route('admin.hotels.create') }}" class="btn">Добавить отель</a>
|
|
|
|
<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: #666;">Редактировать</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>
|
|
</div>
|
|
@endsection |