S
S
stoletvobed912016-04-15 10:03:13
Laravel
stoletvobed91, 2016-04-15 10:03:13

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]');

My Api\[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());
    }

}

Please tell me what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Sokolov, 2016-04-15
@eX1stenZ

I dare to assume that you are using NGINX, and you simply do not have the correct config configuration

A
Alex Wells, 2016-04-15
@Alex_Wells

Incorrect web server configuration.. show configs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question