Not sure what would the problem be but maybe try the helper method: request->all() (without the $ in front)
Oct 17, 2017
12
Level 1
$request->all() returns empty array for GET method laravel 5.5.
Currently I am using Laravel 5.5 for my current project. Now I am facing a strange problem. I have just upload my project on a nginx server which PHP Version => 7.0.24. While I am working on localhost (apache2 php version => 7.1.9) it works fine. But not my nginx server.
The problem is GET request. I have a form of method GET.
<form action="{{ route('test') }}" method="GET" >
<input type="text" name="name">
<input type="text" name="mobile">
<input type="submit" value="Submit">
</form>
Here is my Route -
Route::get('test','SomeController@test')->name('test');
Here is SomeController's 'test' method-
public function test(Request $request){
return $request->all();
}
It shows me all values when I run this 'test' route in localhost but it return empty array when I run it on the shared hosting nginx server. I cannot capture any problem. Please help somebody please.
Please or to participate in this conversation.