I created an URL String:
http://SERVER/v1/responders?latitude=48.25969809999999&longitude=11.43467940000005
a route:
Route::get('/responders', 'Responders\APIResponderController@index');
and a controller:
public function index(Request $request) {
// Get Latitude and Longitude from request url
$latitude = $request["latitude"];
$longitude = $request["longitude"];
$responders = new Responder();
if(!isset($latitude) & !isset($longitude)) {
}
But the result is not what I expected. The parameters in the URL string are not being parsed withing the controller. Do I parse them in a wrong way?
I tried to dump my input with dd($request->all());
but the output is NULL. As the URL is sent correctly, I wonder where the data gets lost. Is my route file incorrect?
Update Could it be my nginx config??
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/mfserver/public;
index index.php index.html index.htm;
charset utf-8;
server_name SERVER;
location / {
try_files $uri $uri/ /index.php?query_string;
}
error_page 404 /index.php;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/mfserver/public;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}