Support the ongoing development of Laravel.io →
posted 8 years ago
Requests
Last updated 1 year ago.
0

Route::currentRouteName() will return the route. Route::input() will return an array of route params

0

vioza said:

Note: i know $_GET variables are bad to use but it''s a temp solution.

Thnx

$_GET variables are not bad if used correctly. I see get variables on fedex site often. But not good for secure data.
Looks like you are using method="POST". If using get variables probably should be method="GET". Need a route something like:

Route::get('owners', array('uses' => 'PownersController@ownerlist'));

And just get the data in controller like

$yourvar = $_GET['yourpassedgetvariable'];

And no a superglobal is not bad here, the data is seen anyway in the url.
However if POST data use the laravel:

$name = Request::input('name');//way of getting post vars
Last updated 8 years ago.
0

While reading the API documentation, you can also do the following:

$query = $request->query();

Documentation link: https://laravel.com/api/5.3/Illuminate/Http/Request.html#metho...

0

You can try this:

$query = $this->getQueryString();

See: https://github.com/laravel/framework/blob/5.4/src/Illuminate/H...

0

Sign in to participate in this thread!

Eventy

Your banner here too?

vioza vioza Joined 18 Feb 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.