Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a6d0cc2d41 | |||
| 2a69d676e1 | |||
| 157efd8df0 |
@@ -32,16 +32,13 @@ class DashboardController extends Controller
|
|||||||
|
|
||||||
$favoritesCount = Favorite::count();
|
$favoritesCount = Favorite::count();
|
||||||
|
|
||||||
$paymentsCount = Payment::count();
|
|
||||||
|
|
||||||
return view('admin.dashboard', compact(
|
return view('admin.dashboard', compact(
|
||||||
'usersCount',
|
'usersCount',
|
||||||
'toursCount',
|
'toursCount',
|
||||||
'flightsCount',
|
'flightsCount',
|
||||||
'airportsCount',
|
'airportsCount',
|
||||||
'commentsCount',
|
'commentsCount',
|
||||||
'favoritesCount',
|
'favoritesCount'
|
||||||
'paymentsCount'
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,179 @@
|
|||||||
|
@extends('admin.layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'افزودن فرودگاه')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<div class="container-fluid py-4">
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<!-- Be present above all else. - Naval Ravikant -->
|
<h4 class="mb-1">افزودن فرودگاه جدید</h4>
|
||||||
|
|
||||||
|
<small class="text-muted">
|
||||||
|
ثبت اطلاعات فرودگاه
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<a href="{{ route('admin.airports.index') }}"
|
||||||
|
class="btn btn-outline-secondary btn-sm">
|
||||||
|
بازگشت
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="card custom-card">
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<form action="{{ route('admin.airports.store') }}"
|
||||||
|
method="POST">
|
||||||
|
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
|
||||||
|
{{-- نام فرودگاه --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label class="form-label">
|
||||||
|
نام فرودگاه
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
|
name="name"
|
||||||
|
value="{{ old('name') }}"
|
||||||
|
class="form-control @error('name') is-invalid @enderror"
|
||||||
|
placeholder="مثلاً فرودگاه امام خمینی">
|
||||||
|
|
||||||
|
@error('name')
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
@enderror
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- کد فرودگاه --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label class="form-label">
|
||||||
|
کد فرودگاه
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
|
name="code"
|
||||||
|
value="{{ old('code') }}"
|
||||||
|
class="form-control @error('code') is-invalid @enderror"
|
||||||
|
placeholder="مثلاً IKA">
|
||||||
|
|
||||||
|
@error('code')
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
@enderror
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- استان --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label class="form-label">
|
||||||
|
استان
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
|
name="province"
|
||||||
|
value="{{ old('province') }}"
|
||||||
|
class="form-control @error('province') is-invalid @enderror">
|
||||||
|
|
||||||
|
@error('province')
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
@enderror
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- شهر --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label class="form-label">
|
||||||
|
شهر
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
|
name="city"
|
||||||
|
value="{{ old('city') }}"
|
||||||
|
class="form-control @error('city') is-invalid @enderror">
|
||||||
|
|
||||||
|
@error('city')
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
@enderror
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- وضعیت --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label class="form-label">
|
||||||
|
وضعیت
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<select name="status"
|
||||||
|
class="form-select">
|
||||||
|
|
||||||
|
<option value="1"
|
||||||
|
{{ old('status', 1) == 1 ? 'selected' : '' }}>
|
||||||
|
فعال
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option value="0"
|
||||||
|
{{ old('status') == 0 ? 'selected' : '' }}>
|
||||||
|
غیرفعال
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="d-flex gap-2 mt-4">
|
||||||
|
|
||||||
|
<button type="submit"
|
||||||
|
class="btn btn-primary">
|
||||||
|
|
||||||
|
ثبت فرودگاه
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<a href="{{ route('admin.airports.index') }}"
|
||||||
|
class="btn btn-light">
|
||||||
|
|
||||||
|
انصراف
|
||||||
|
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endsection
|
||||||
|
|||||||
@@ -1,3 +1,274 @@
|
|||||||
|
@extends('admin.layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'ویرایش فرودگاه')
|
||||||
|
|
||||||
|
@section('breadcrumb')
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<!-- Because you are alive, everything is possible. - Thich Nhat Hanh -->
|
|
||||||
|
<h1 class="page-title fw-medium fs-18 mb-2">
|
||||||
|
ویرایش فرودگاه
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<nav>
|
||||||
|
|
||||||
|
<ol class="breadcrumb mb-0">
|
||||||
|
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
|
||||||
|
<a href="{{ route('admin.dashboard.index') }}">
|
||||||
|
داشبورد
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
|
||||||
|
<a href="{{ route('admin.airports.index') }}">
|
||||||
|
مدیریت فرودگاهها
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="breadcrumb-item active">
|
||||||
|
ویرایش فرودگاه
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<div class="container-fluid pt-4">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-xl-8 col-lg-10 mx-auto">
|
||||||
|
|
||||||
|
<div class="card custom-card">
|
||||||
|
|
||||||
|
<div class="card-header">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<h5 class="mb-1">
|
||||||
|
ویرایش فرودگاه
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<small class="text-muted">
|
||||||
|
ویرایش اطلاعات {{ $airport->name }}
|
||||||
|
</small>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<form action="{{ route('admin.airports.update', $airport) }}"
|
||||||
|
method="POST">
|
||||||
|
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
@method('PUT')
|
||||||
|
|
||||||
|
|
||||||
|
{{-- نام فرودگاه --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label for="name"
|
||||||
|
class="form-label">
|
||||||
|
|
||||||
|
نام فرودگاه
|
||||||
|
<span class="text-danger">*</span>
|
||||||
|
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
|
id="name"
|
||||||
|
name="name"
|
||||||
|
value="{{ old('name', $airport->name) }}"
|
||||||
|
class="form-control @error('name') is-invalid @enderror"
|
||||||
|
placeholder="نام فرودگاه">
|
||||||
|
|
||||||
|
@error('name')
|
||||||
|
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@enderror
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- کد فرودگاه --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label for="code"
|
||||||
|
class="form-label">
|
||||||
|
|
||||||
|
کد فرودگاه
|
||||||
|
<span class="text-danger">*</span>
|
||||||
|
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
|
id="code"
|
||||||
|
name="code"
|
||||||
|
value="{{ old('code', $airport->code) }}"
|
||||||
|
class="form-control @error('code') is-invalid @enderror"
|
||||||
|
placeholder="مثلاً IKA">
|
||||||
|
|
||||||
|
@error('code')
|
||||||
|
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@enderror
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- استان --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label for="province"
|
||||||
|
class="form-label">
|
||||||
|
|
||||||
|
استان
|
||||||
|
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
|
id="province"
|
||||||
|
name="province"
|
||||||
|
value="{{ old('province', $airport->province) }}"
|
||||||
|
class="form-control @error('province') is-invalid @enderror"
|
||||||
|
placeholder="نام استان">
|
||||||
|
|
||||||
|
@error('province')
|
||||||
|
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@enderror
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- شهر --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label for="city"
|
||||||
|
class="form-label">
|
||||||
|
|
||||||
|
شهر
|
||||||
|
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
|
id="city"
|
||||||
|
name="city"
|
||||||
|
value="{{ old('city', $airport->city) }}"
|
||||||
|
class="form-control @error('city') is-invalid @enderror"
|
||||||
|
placeholder="نام شهر">
|
||||||
|
|
||||||
|
@error('city')
|
||||||
|
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@enderror
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- وضعیت --}}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
|
||||||
|
<label for="status"
|
||||||
|
class="form-label">
|
||||||
|
|
||||||
|
وضعیت
|
||||||
|
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<select id="status"
|
||||||
|
name="status"
|
||||||
|
class="form-select @error('status') is-invalid @enderror">
|
||||||
|
|
||||||
|
<option value="1"
|
||||||
|
{{ old('status', $airport->status) == 1 ? 'selected' : '' }}>
|
||||||
|
فعال
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option value="0"
|
||||||
|
{{ old('status', $airport->status) == 0 ? 'selected' : '' }}>
|
||||||
|
غیرفعال
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
@error('status')
|
||||||
|
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@enderror
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- دکمهها --}}
|
||||||
|
|
||||||
|
<div class="d-flex gap-2 mt-4">
|
||||||
|
|
||||||
|
<button type="submit"
|
||||||
|
class="btn btn-primary">
|
||||||
|
|
||||||
|
<i class="fa fa-save me-1"></i>
|
||||||
|
|
||||||
|
بروزرسانی فرودگاه
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
<a href="{{ route('admin.airports.index') }}"
|
||||||
|
class="btn btn-light">
|
||||||
|
|
||||||
|
انصراف
|
||||||
|
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endsection
|
||||||
|
|||||||
@@ -1,3 +1,76 @@
|
|||||||
|
@extends('admin.layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'مدیریت فرودگاهها')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container-fluid py-4">
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
<div>
|
<div>
|
||||||
<!-- We must ship. - Taylor Otwell -->
|
<h4 class="mb-0">مدیریت فرودگاهها</h4>
|
||||||
|
<span class="text-muted small">تعداد کل: {{ $airports->total() }} فرودگاه</span>
|
||||||
</div>
|
</div>
|
||||||
|
<a href="{{ route('admin.airports.create') }}" class="btn btn-primary">
|
||||||
|
<i class="bi bi-plus-lg"></i> افزودن فرودگاه
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (session('success'))
|
||||||
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||||
|
{{ session('success') }}
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="بستن"></button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="card shadow-sm">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover align-middle mb-0">
|
||||||
|
<thead class="table-light">
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>نام فرودگاه</th>
|
||||||
|
<th>کد</th>
|
||||||
|
<th>استان</th>
|
||||||
|
<th>شهر</th>
|
||||||
|
<th class="text-center">عملیات</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@forelse ($airports as $airport)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $airport->id }}</td>
|
||||||
|
<td class="fw-semibold">{{ $airport->name }}</td>
|
||||||
|
<td>{{ $airport->code }}</td>
|
||||||
|
<td>{{ $airport->province }}</td>
|
||||||
|
<td>{{ $airport->city }}</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div class="d-inline-flex gap-2">
|
||||||
|
<a href="{{ route('admin.airports.edit', $airport) }}"
|
||||||
|
class="btn btn-sm btn-outline-primary">ویرایش</a>
|
||||||
|
|
||||||
|
<form action="{{ route('admin.airports.destroy', $airport) }}"
|
||||||
|
method="POST"
|
||||||
|
onsubmit="return confirm('آیا از حذف فرودگاه {{ $airport->name }} مطمئن هستید؟')">
|
||||||
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
<button type="submit" class="btn btn-sm btn-outline-danger">حذف</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td colspan="6" class="text-center text-muted py-5">
|
||||||
|
هنوز فرودگاهی ثبت نشده است.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-3">
|
||||||
|
{{ $airports->links() }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|||||||
+38
-3
@@ -11,18 +11,53 @@ Route::prefix('auth')->name('auth.')->group(function () {
|
|||||||
Route::middleware('guest:web')->group(function () {
|
Route::middleware('guest:web')->group(function () {
|
||||||
|
|
||||||
Route::controller(RegisterController::class)
|
Route::controller(RegisterController::class)
|
||||||
->prefix('register')->name('register.')->group(function () {
|
->prefix('register')
|
||||||
|
->name('register.')
|
||||||
|
->group(function () {
|
||||||
|
|
||||||
Route::get('/', 'index')->name('index');
|
Route::get('/', 'index')->name('index');
|
||||||
|
|
||||||
Route::post('/', 'post')->name('post');
|
Route::post('/', 'post')->name('post');
|
||||||
|
|
||||||
|
Route::get('cities/{province}', 'cities')
|
||||||
|
->name('cities');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Route::controller(LoginController::class)
|
Route::controller(LoginController::class)
|
||||||
->prefix('login')->name('login.')->group(function () {
|
->prefix('login')
|
||||||
|
->name('login.')
|
||||||
|
->group(function () {
|
||||||
|
|
||||||
Route::get('/', 'index')->name('index');
|
Route::get('/', 'index')->name('index');
|
||||||
|
|
||||||
Route::post('/', 'post')->name('post');
|
Route::post('/', 'post')->name('post');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Route::get('logout', [LogoutController::class, 'index'])
|
Route::get('logout', [LogoutController::class, 'index'])
|
||||||
->middleware('auth:web')->name('logout');
|
->middleware('auth:web')
|
||||||
|
->name('logout');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Route::prefix('auth')->name('auth.')->group(function () {
|
||||||
|
//
|
||||||
|
// Route::middleware('guest:web')->group(function () {
|
||||||
|
//
|
||||||
|
// Route::controller(RegisterController::class)
|
||||||
|
// ->prefix('register')->name('register.')->group(function () {
|
||||||
|
// Route::get('/', 'index')->name('index');
|
||||||
|
// Route::post('/', 'post')->name('post');
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// Route::controller(LoginController::class)
|
||||||
|
// ->prefix('login')->name('login.')->group(function () {
|
||||||
|
// Route::get('/', 'index')->name('index');
|
||||||
|
// Route::post('/', 'post')->name('post');
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// Route::get('logout', [LogoutController::class, 'index'])
|
||||||
|
// ->middleware('auth:web')->name('logout');
|
||||||
|
//});
|
||||||
|
|||||||
Reference in New Issue
Block a user