90 lines
3.5 KiB
PHP
90 lines
3.5 KiB
PHP
<?php
|
|
|
|
|
|
use App\Http\Controllers\Account\CommentController as AccountCommentController;
|
|
use App\Http\Controllers\Account\EditProfileController;
|
|
use App\Http\Controllers\Account\FavoriteController as AccountFavoriteController;
|
|
use App\Http\Controllers\BookingController as SiteBookingController;
|
|
use App\Http\Controllers\CommentController;
|
|
use App\Http\Controllers\FavoriteController;
|
|
use App\Http\Controllers\FlightController;
|
|
use App\Http\Controllers\IndexController;
|
|
|
|
use App\Http\Controllers\TourController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
// ------------------------------ صفحه اصلی ------------------------------
|
|
Route::get('/', [IndexController::class, 'index'])->name('index');
|
|
|
|
// ------------------------------ تورها ------------------------------
|
|
Route::prefix('tours')
|
|
->name('tours.')
|
|
->controller(TourController::class)
|
|
->group(function () {
|
|
Route::get('/', 'index')->name('index');
|
|
Route::get('remove-filters', 'removeFilters')->name('remove-filters');
|
|
Route::get('search/suggestion', 'searchSuggestion')->name('searchSuggestion');
|
|
Route::get('{tour}', 'show')->name('show');
|
|
});
|
|
|
|
// ------------------------------ پروازها ------------------------------
|
|
Route::prefix('flights')
|
|
->name('flights.')
|
|
->controller(FlightController::class)
|
|
->group(function () {
|
|
Route::get('/', 'index')->name('index');
|
|
Route::get('search', 'search')->name('search');
|
|
Route::get('{flight}', 'show')->name('show');
|
|
});
|
|
|
|
// ------------------------------ نظرات (پلیمورفیک) ------------------------------
|
|
Route::prefix('comments')
|
|
->name('comments.')
|
|
->middleware('auth')
|
|
->controller(AccountCommentController::class) // اصلاح شد: استفاده از کنترلر صحیح
|
|
->group(function () {
|
|
Route::post('tour/{tour}', 'storeTour')->name('tour.store');
|
|
Route::post('flight/{flight}', 'storeFlight')->name('flight.store');
|
|
});
|
|
|
|
// ------------------------------ علاقهمندیها (عمومی) ------------------------------
|
|
Route::prefix('favorites')->name('favorites.')->middleware('auth')->controller(FavoriteController::class)->group(function () {
|
|
Route::post('toggle', 'toggle')->name('toggle');
|
|
});
|
|
|
|
// ------------------------------ رزرو ------------------------------
|
|
Route::prefix('booking')
|
|
->name('booking.')
|
|
->middleware('auth')
|
|
->controller(SiteBookingController::class)
|
|
->group(function () {
|
|
Route::get('/', 'index')->name('index');
|
|
Route::post('tours/{tour}', 'store')->name('store');
|
|
Route::get('flights/{flight}', 'flight')->name('flight');
|
|
Route::post('flights/{flight}', 'storeFlight')->name('flight.store');
|
|
});
|
|
|
|
// ------------------------------ پنل کاربری ------------------------------
|
|
Route::prefix('account')
|
|
->name('account.')
|
|
->middleware('auth')
|
|
->group(function () {
|
|
|
|
Route::get('/', [IndexController::class, 'index'])->name('index');
|
|
|
|
// علاقهمندیها
|
|
Route::get('favorites', [AccountFavoriteController::class, 'index'])->name('favorites');
|
|
|
|
// نظرات
|
|
Route::get('comments', [AccountCommentController::class, 'myComments'])->name('comments');
|
|
|
|
// پروفایل
|
|
Route::prefix('edit-profile')
|
|
->name('edit-profile.')
|
|
->controller(EditProfileController::class)
|
|
->group(function () {
|
|
Route::get('/', 'index')->name('index');
|
|
Route::post('/', 'post')->name('post');
|
|
});
|
|
});
|