59 lines
2.7 KiB
PHP
59 lines
2.7 KiB
PHP
@extends('admin.layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container-fluid pt-4">
|
|
<div class="card custom-card">
|
|
<div class="card-header d-flex align-items-center justify-content-between">
|
|
<div class="card-title">مدیریت شهرستانها</div>
|
|
<a href="{{ route('admin.cities.create') }}" class="btn btn-primary btn-sm">
|
|
افزودن شهرستان
|
|
</a>
|
|
</div>
|
|
|
|
<div class="card-body pt-0">
|
|
<div class="table-responsive">
|
|
<table class="table text-nowrap">
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>نام شهرستان</th>
|
|
<th>استان</th>
|
|
<th>عملیات</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($cities as $city)
|
|
<tr>
|
|
<td>{{ $city->id }}</td>
|
|
<td>{{ $city->name }}</td>
|
|
<td>{{ optional($city->province)->name ?? '—' }}</td>
|
|
<td>
|
|
<a href="{{ route('admin.cities.edit', $city->id) }}" class="btn btn-sm btn-warning">
|
|
ویرایش
|
|
</a>
|
|
|
|
<form action="{{ route('admin.cities.destroy', $city->id) }}" method="POST" class="d-inline">
|
|
@csrf
|
|
@method('delete')
|
|
<button type="submit" class="btn btn-sm btn-danger"
|
|
onclick="return confirm('آیا مطمئن هستید؟')">
|
|
حذف
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="4" class="text-center">شهرستانی ثبت نشده است</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{{ $cities->links() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|