I\'m trying to get a url parameter from a view file.
I have this url:
http://locahost:8000/example?a=10
and a view file na
This works well:
{{ app('request')->input('a') }}
Where a
is the url parameter.
See more here: http://blog.netgloo.com/2015/07/17/lumen-getting-current-url-parameter-within-a-blade-view/
The shortest way i have used
{{ Request::get('a') }}
Laravel 5.6:
{{ Request::query('parameter') }}
Laravel 5.8
{{ request()->a }}
As per official 5.8 docs:
The request() function returns the current request instance or obtains an input item:
$request = request();
$value = request('key', $default);
Docs
More simple in Laravel 5.7 and 5.8
{{ Request()->parameter }}