Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/routes/Front/api.php
Назад
<?php use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use App\Http\Controllers\Api; use App\Http\Controllers\Api\ReviewApiController; use App\Http\Controllers\Api\WishlistApiController; use App\Http\Controllers\AuthApi\AuthenticatedController; use App\Http\Controllers\AuthApi\EmailVerificationNotificationController; use App\Http\Controllers\AuthApi\NewPasswordController; use App\Http\Controllers\AuthApi\PasswordResetLinkController; use App\Http\Controllers\AuthApi\ProfileController; use App\Http\Controllers\AuthApi\RegisteredUserController; use App\Http\Controllers\AuthApi\TwoFactorAuthenticationController; use App\Http\Controllers\AuthApi\VerifyEmailController; use Illuminate\Validation\UnauthorizedException; use Laravel\Sanctum\Sanctum; /* |-------------------------------------------------------------------------- | API Routes |-------------------------------------------------------------------------- | | Here is where you can register API routes for your application. These | routes are loaded by the RouteServiceProvider and all of them will | be assigned to the "api" middleware group. Make something great! | */ Route::get('/header-menus', [Api\MenuApiController::class, 'header']); Route::get('/search-collections', [Api\SearchApiController::class, 'index']); Route::get('destinations/{slug}', [Api\DestinationApiController::class, 'show']) ->where('slug', '.*'); Route::get('liveaboard/{slug}', [Api\LiveaboardApiController::class, 'show']) ->where('slug', '.*'); Route::get('articles/', [Api\ArticleApiController::class, 'index']); Route::get('articles/{slug}', [Api\ArticleApiController::class, 'show']); Route::get('resort/{slug}', [Api\ResortApiController::class, 'show']) ->where('slug', '.*'); Route::get('resort-detail/{slug}', [Api\ResortApiController::class, 'resortDetail']); Route::get('top-ten-destinations/', [Api\TopTenDestinationApiController::class, 'index']); Route::get('team/', [Api\TeamApiController::class, 'index']); Route::get('team/{slug}', [Api\TeamApiController::class, 'show']); Route::get('pages/{slug}', [Api\PageApiController::class, 'show']); Route::get('destinations-finder', [Api\DestinationFinderApiController::class, 'index']); //Api Auth related // Register Route::post('/register', [RegisteredUserController::class, 'store'])->name('api.register'); // Login Route::post('/login', [AuthenticatedController::class, 'store']); // Send reset password email Route::post('/forgot-password', [PasswordResetLinkController::class, 'store']) ->name('api.password.email'); // Reset password Route::post('/reset-password', [NewPasswordController::class, 'store']) ->name('api.password.update'); Route::get('/reset-password/{token}', function (string $token) { return view('auth.reset-password', ['token' => $token]); })->middleware('guest')->name('password.reset'); // Verify email address // We don't want to make this route available for authenticated user (we use stateless API, not session) // Route::get('/verify-email/{id}/{hash}', VerifyEmailController::class) // ->withoutMiddleware(['throttle:api']) // ->middleware(['signed', 'throttle:6,1,verify-email']) // ->name('verification.verify'); Route::middleware('auth:sanctum')->group(function () { // Resend verification email Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store']) ->withoutMiddleware(['throttle:api']) ->middleware(['throttle:6,1,resend-email-verification']) ->name('verification.send'); // Logout (delete user's token) Route::post('/logout', [AuthenticatedController::class, 'destroy']) ->name('api.logout'); Route::get('/user-profile', [ProfileController::class, 'show']) ->name('user.profile.show'); Route::post('/user-profile', [ProfileController::class, 'update']) ->name('user.profile.update'); Route::get('/wishlist', [WishlistApiController::class, 'index']); Route::post('/wishlist/add', [WishlistApiController::class, 'add']); Route::post('/wishlist/remove', [WishlistApiController::class, 'delete']); Route::post('/profile/add-location', [ProfileController::class, 'addLocation']); Route::delete('/profile/delete-location/{locationId}', [ProfileController::class, 'deleteLocation']); // 2FA related routes Route::withoutMiddleware(['throttle:api'])->middleware('verified', 'throttle:6,1,2fa-verification')->group(function () { Route::post('/verify-two-factor-code', [TwoFactorAuthenticationController::class, 'store']); Route::post('/verify-two-factor-code/resend', [TwoFactorAuthenticationController::class, 'resend']); }); }); Route::get('/user', function (Request $request) { $token = $request->bearerToken(); try { $user = Sanctum::personalAccessTokenModel()::findToken($token)->tokenable; if (!$user) { return response()->json([ 'status' => 'error', 'message' => 'Token has expired or is invalid.', ], 401); } return response()->json([ 'status' => 'success', 'message' => 'User Data', 'data' => $user, ], 200); } catch (\Exception $e) { return response()->json([ 'status' => 'error', 'message' => 'Token has expired or is invalid.', ], 401); } }); Route::get('booking-resort/{slug}', [Api\BookingResortApiController::class, 'show']); Route::post('booking-resort', [Api\BookingResortApiController::class, 'save']); Route::get('booking-liveaboard/{slug}', [Api\BookingLiveaboardApiController::class, 'show']); Route::post('booking-liveaboard', [Api\BookingLiveaboardApiController::class, 'save']); Route::get('guided-group-trip', [Api\GuidedGroupTripApiController::class, 'index']); Route::get('guided-group-trip-detail/{slug}', [Api\GuidedGroupTripApiController::class, 'show']); Route::get('deal-special-offer', [Api\DealSpecialOfferApiController::class, 'index']); Route::post('review/create', [Api\ReviewApiController::class, 'create']); Route::get('review/entity', [Api\ReviewApiController::class, 'reviewByEntity']); Route::get('indexed-site-maps', [Api\SiteMapApiController::class, 'index']);
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка