forked from projects/fipamo
ro
3d17771f76
The first part of improving the API is removing all admin functions from the front end so those no admin methods will be available client side. The urls in the FipamoAdmin js file have been changed to post directly to the system and they are handled from there. To account for this change controller routes for every standard method have been created for better organization and readability. The FipamoAdmin js file will be integrated with the rest of the front end code and will not be seperate library
29 lines
1.2 KiB
PHP
29 lines
1.2 KiB
PHP
<?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);
|