Answer the question
In order to leave comments, you need to log in
Is it possible to somehow emit the execution of the php file recorded in the url through routes?
This is the request sent
by lara-1c.local/bitrix/admin/1c_exchange.php from 1c and it doesn't matter where else.
How would I make it with routes so that this url is treated as a route and if this request comes in to run the controller function? I can't implement it anyway.
If I simply create the 1c_exchange.php file in the public folder, then this file can even be launched. but I don't need it.
I need to catch all the parameters that are passed along with the file in the controller function.
Answer the question
In order to leave comments, you need to log in
Laravel doesn't care what you write in its routes. Such a route will be processed in the same way as all the others.
Route::get('/bitrix/admin/1c_exchange.php', function () {
dd(request()->all());
});
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
Route::get('/bitrix/admin/1c_exchange.php', [SomeController::class, 'someMethod'])
You need to use a mask so that the framework does not break the route by slashes. Well, do not forget about security, so that absolutely any file cannot be opened.
Route::get('{path}', function ($path) {
require $path;
})->where('path, '.*'); // маска
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question