I have a problem with laravel where the query string shows empty:
If I do /en/news/some-news-slug, it gets the input as needed. However, if I do /en/news?page=2, it doesn't show that I have 'page' query string parameter. Here is my nginx configuration:
conf.d/php.conf
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
server:
server {
listen 80;
# root and servername hidden
location / {
try_files $uri $uri/ /index.php$args;
}
index index.php;
include conf.d/php.conf;
}
Controller:
public function index(Request $request)
{
var_dump($request->query());
$posts = $this->post->paginate(App::getLocale(), 2);
foreach($posts as $post) {
echo $post->id. ' ';
}
die;
}
$request->pageor$request->input('page'). Does either of those get the right variable?