Files
2026-08-22 11:15:20 +03:30

93 lines
2.9 KiB
PHP

<?php
use App\Http\Controllers\Account\BookingController;
use App\Http\Controllers\Account\EditProfileController;
use App\Http\Controllers\Account\FavoriteController;
use App\Http\Controllers\Account\ProfileController;
use App\Http\Controllers\Account\WishlistController;
use App\Http\Controllers\Account\CommentStatusController;
use App\Http\Controllers\CommentController;
use App\Http\Controllers\FlightController;
use App\Http\Controllers\IndexController;
use App\Http\Controllers\TourController;
use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;
use Illuminate\Foundation\Auth\EmailVerificationRequest;
Route::get('/', [IndexController::class, 'index'])->name('index');
Route::prefix('flights')
->name('flights.')
->controller(FlightController::class)
->group(function () {
Route::get('/', 'index')->name('index');
Route::get('/{flight}', 'show')->name('show');
});
Route::prefix('tours')
->name('tours.')
->controller(TourController::class)
->group(function () {
Route::get('/', 'index')->name('index');
Route::get('/{tour}', 'show')->name('show');
});
Route::controller(CommentController::class)
->group(function () {
Route::post('/flights/{flight}/comments', 'flightStore')->name('flights.comments.store');
Route::post('/tours/{tour}/comments', 'tourStore')->name('tours.comments.store');
});
Route::get('/email/verify', function () {
return view('auth.verify-email');
})->middleware('auth')->name('verification.notice');
Route::get('/email/verify/{id}/{hash}', function (EmailVerificationRequest $request) {
$request->fulfill();
return redirect()->route('account.profile');
})->middleware(['auth', 'signed'])->name('verification.verify');
Route::post('/email/verification-notification', function (Request $request) {
$request->user()->sendEmailVerificationNotification();
return back()->with('message', 'لینک فعال سازی مجدداً ارسال شد.');
})->middleware(['auth', 'throttle:6,1'])->name('verification.send');
Route::prefix('account')->name('account.')->middleware('auth')->group(function () {
Route::get('profile', [ProfileController::class, 'index'])->name('profile');
Route::get('wishlist', [WishlistController::class, 'index'])->name('wishlist');
Route::prefix('edit-profile')->name('edit-profile.')->controller(EditProfileController::class)->group(function () {
Route::get('/', 'index')->name('index');
Route::put('/', 'post')->name('post');
});
Route::post('favorites/{type}/{id}/toggle', [FavoriteController::class, 'toggle'])->name('favorites.toggle');
Route::get('comments', [CommentStatusController::class, 'index'])
->name('comments');
Route::post('booking', [BookingController::class, 'store'])
->name('booking.store');
Route::get('booking', [BookingController::class, 'index'])
->name('booking');
});