2024-01-16 15:14:13 +04:00
|
|
|
@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">
|
|
|
|
<div class="mb-3">
|
|
|
|
<h5><strong>Название: </strong>{{ $car->name ?? "" }}</h5>
|
|
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
|
|
<h5><strong>Гос. номер: </strong> {{ $car->number ?? ""}} </h5>
|
|
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
|
|
<h5><strong>ФИО владельца: </strong>{{ $car->user->fio ?? "" }}</h5>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-18 16:41:28 +04:00
|
|
|
@can('update', $car)
|
|
|
|
<div class="card-footer">
|
|
|
|
<a href="{{ route('cars.edit', $car) }}" class="btn btn-primary">Редактировать</a>
|
|
|
|
</div>
|
|
|
|
@endcan
|
2024-01-16 15:14:13 +04:00
|
|
|
</div>
|
2024-01-18 16:41:28 +04:00
|
|
|
<div class="card mt-4">
|
|
|
|
<div class="card-header">{{__('Автомобиль')}}</div>
|
|
|
|
<div class="card-body">
|
|
|
|
@if ($user->car)
|
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<th>Название</th>
|
|
|
|
<th>Номер</th>
|
|
|
|
<th> </th>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="table-text">
|
|
|
|
<div>
|
|
|
|
{{ $user->car->name }}
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div>
|
|
|
|
{{ $user->car->number }}
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
@can('update', $car)
|
2024-01-16 15:14:13 +04:00
|
|
|
<td>
|
|
|
|
<a href="{{ route('cars.edit', $user->car) }}" class="btn btn-warning">Редактировать</a>
|
|
|
|
</td>
|
2024-01-18 16:41:28 +04:00
|
|
|
@endcan
|
|
|
|
@can('delete', $car)
|
2024-01-16 15:14:13 +04:00
|
|
|
<td>
|
|
|
|
<form action="{{ route('cars.destroy', $user->car) }}" method="POST" style="display: inline-block;">
|
|
|
|
@csrf
|
|
|
|
@method('DELETE')
|
|
|
|
<button type="submit" class="btn btn-danger">Удалить</button>
|
|
|
|
</form>
|
|
|
|
</td>
|
2024-01-18 16:41:28 +04:00
|
|
|
@endcan
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
@else
|
|
|
|
<a href="{{ route('cars.create', $user) }}" class="btn btn-success">Добавить</a>
|
|
|
|
<div class="mt-4">
|
|
|
|
<label class="form-label"><strong>Автомобиль отсутствует</strong></label>
|
|
|
|
</div>
|
|
|
|
@endif
|
2024-01-16 15:14:13 +04:00
|
|
|
</div>
|
2024-01-18 16:41:28 +04:00
|
|
|
</div>
|
2024-01-16 15:14:13 +04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|
|
|
|
|