Files
hatame.andarza09/resources/views/admin/provinces/index.blade.php
T

171 lines
3.9 KiB
PHP

@extends('admin.layouts.app')
@section('breadcrumb')
<span>
مدیریت استان‌ها
</span>
@endsection
@section('content')
<div class="container-fluid mt-4">
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h3 class="fw-bold mb-1">
مدیریت استان‌ها
</h3>
<small class="text-muted">
لیست استان‌های ثبت شده
</small>
</div>
<a href="{{ route('admin.provinces.create') }}"
class="btn btn-primary px-4">
<i class="bi bi-plus-circle"></i>
افزودن استان
</a>
</div>
<div class="card border-0 shadow-sm">
<div class="card-body p-4">
<div class="table-responsive">
<table class="table table-hover align-middle text-center">
<thead class="table-light">
<tr>
<th>
شناسه
</th>
<th>
نام استان
</th>
<th>
تاریخ ثبت
</th>
<th>
عملیات
</th>
</tr>
</thead>
<tbody>
@forelse($provinces as $province)
<tr>
<td>
<span class="badge bg-secondary">
{{ $province->id }}
</span>
</td>
<td class="fw-bold">
{{ $province->name }}
</td>
<td>
{{ $province->created_at?->toJalali()->format('Y/m/d') ?? '-' }}
</td>
<td>
<a href="{{ route('admin.provinces.edit',$province->id) }}"
class="btn btn-sm btn-warning">
ویرایش
</a>
<form action="{{ route('admin.provinces.destroy',$province->id) }}"
method="POST"
class="d-inline">
@csrf
@method('DELETE')
<button class="btn btn-sm btn-danger"
onclick="return confirm('آیا حذف شود؟')">
حذف
</button>
</form>
</td>
</tr>
@empty
<tr>
<td colspan="4"
class="text-muted py-4">
هنوز استانی ثبت نشده است
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="mt-3">
{{ $provinces->links() }}
</div>
</div>
</div>
</div>
@endsection