Answer the question
In order to leave comments, you need to log in
How to correctly make routing based on the values passed in the POST request?
Hello coding masters!
I want to make routing for SPA based on the parameters passed in the POST request so that it is not visible to prying eyes which addresses are requested by the user when using the application. After a little thought, I made such a completely workable option, with the exception of the impossibility of using redirects between routes
Route::group([
'prefix' => 'api',
'namespace' => 'Api',
], function () {
$actions = [
'login' => '[email protected]',
'logout' => '[email protected]',
'authCurrent' => '[email protected]'
];
$act = request()->input('act');
$action = isset($actions[$act]) ? $actions[$act] : '[email protected]';
Route::post('', $action);
});
Answer the question
In order to leave comments, you need to log in
Of course, I'm not an expert, but devtools show everything all of a sudden.
What is this "protection" from?
You can make it difficult for yourself in simpler ways.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question