Answer the question
In order to leave comments, you need to log in
How to get get parameters in Laravel?
Good day!
I don't understand what the troubles are. I am new to Laravel, I want to feel and evaluate it in order to understand mine or not.
At the moment I encountered the following problem:
For some reason I can not get get parameters inside the controller.
$request->all() returns [].
Input::get('number') returns null.
$_GET, $_REQUEST are also empty.
Well, I can't get the data.
Request:
/api/play.takePlace?game_id=2&place=9&number=6
My routing:
Route::auth();
Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'adminverify']], function() {
Route::get('/', 'Admin\[email protected]');
});
Route::group(['prefix' => 'api'], function() {
Route::get("play.takePlace", "Api\PlayControl[email protected]");
});
Route::get('/', '[email protected]');
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
class PlayController extends \App\Http\Controllers\Controller {
public function takePlace(Request $request) {
dd($request->all());
}
}
Answer the question
In order to leave comments, you need to log in
I dare to assume that you are using NGINX, and you simply do not have the correct config configuration
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question