Answer the question
In order to leave comments, you need to log in
How to avoid 404 error in Laravel if route ends with php?
created a route containing a php file at the end, namely:
//https://sitename.ru/bitrix/admin/1c_exchange.php
Route::get('bitrix/admin/1c_exchange.php', [getFilesController::class,'getDataFrom1C']);
Route::post('bitrix/admin/1c_exchange.php', [getFilesController::class,'getDataFrom1C']);
get
, the post
server gives a 404 error. cors.php
: specified
in the file :'paths' => ['api/*', 'bitrix/*'],
VerifyCsrfToken.php
protected $except = [
'bot/*',
'bitrix/*'
];
Answer the question
In order to leave comments, you need to log in
You are trying to call a non-Laravel file. Hence the scolding. I needed to call test php files in LUMEN here - I did this:
$router->get('tests/{alias}', function(Request $request) {
ob_start();
require($request->path());
return ob_get_clean();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question