jeudi 27 octobre 2016

How to get GET method parameters by laravel 5

I tried to make these code. then I send below request uri http://ift.tt/2e35NTy but, it can't get data parameter. Do you know how to get it?

Route.php

$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function ($api) {
/* API */
$api->group(['prefix' => 'v1',
    'before' => 'v1',
    'middleware' => 'cors',
    'namespace' => 'App\\Http\\Controllers',
    'domain' => '192.168.33.10'
],function ($api) {
    // get company list
    $api->get('/company/', "CompaniesController@index");
});
});

controller.php

   public function index(UsersCreateRequest $request)
   {
    var_dump($request->input('data'));
    $users = $this->repository->all();

    return response()->json([
        'data' => $users,
    ]);
   }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire