fipamo/routes/web.php

29 lines
1.2 KiB
PHP
Raw Permalink Normal View History

<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\RouteGetController;
use App\Http\Controllers\RoutePostController;
use App\Http\Controllers\RoutePutController;
use App\Http\Controllers\RouteDeleteController;
use App\Http\Middleware\VerifyCsrfToken;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
//routing needs a bit more nuance, so requests are sent to a controller to sort traffic
Route::get("/{first?}/{second?}/{third?}/{four?}", [RouteGetController::class, 'handleRequest']);
Route::post("/{first?}/{second?}/{third?}", [RoutePostController::class, 'handleRequest'])
->middleware(VerifyCsrfToken::class);
Route::put("/{first?}/{second?}/{third?}", [RoutePutController::class, 'handleRequest'])
->middleware(VerifyCsrfToken::class);
Route::delete("/{first?}/{second?}/{third?}", [RouteDeleteController::class, 'handleRequest'])
->middleware(VerifyCsrfToken::class);