65 lines
3.1 KiB
PHP
65 lines
3.1 KiB
PHP
@extends('layouts.application')
|
|
|
|
@section('content')
|
|
<div class="container col-md-6">
|
|
<div class="row justify-content-center">
|
|
<div class="card">
|
|
<div class="card-header">{{__('Новая доставка')}}</div>
|
|
<div class="card-body">
|
|
<a href="{{ route('deliveries.create') }}" class="btn btn-success">Добавить</a>
|
|
</div>
|
|
</div>
|
|
@if (count($deliveries))
|
|
<div class="card mt-4">
|
|
<div class="card-header">{{__('Доставки')}}</div>
|
|
<div class="card-body">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<th>Адрес доставки</th>
|
|
<th>Водитель</th>
|
|
<th>Статус</th>
|
|
<th> </th>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($deliveries as $delivery)
|
|
<tr>
|
|
<td class="table-text">
|
|
<div>
|
|
<a href="{{ route('deliveries.show', $delivery) }}" class="btn btn-block col-8">{{ $delivery->address }}</a>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div>
|
|
<p>{{ $delivery->user->fio }}</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div>
|
|
<p>{{ $delivery->status->description()}}</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div>
|
|
<a href="{{ route('deliveries.edit', $delivery) }}" class="btn btn-warning">Редактировать</a>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<form action="{{ route('deliveries.destroy', $delivery) }}" method="POST" style="display: inline-block;">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="btn btn-danger">Удалить</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="card-footer">{{ $deliveries->links() }}</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|