How can I retrive list of route
parameters in Middleware, tried multiple ways but always end with Error or empty result:
public function handle($request, Closure $next)
{
$request->route()->parameter('page'); //Call to a member function parameter() on null
$request->route()->parameters(); //Call to a member function parameters() on null
Request::capture()->getParameter('page'); //Call to undefined method Illuminate\Http\Request::getParameter()
Route::getCurrentRoute()->getParameter('page'); //Call to a member function getParameter() on null
Route::getCurrentRoute()->getParameters(); //Call to a member function getParameters() on null
Route::getParameter('page'); //Method getParameter does not exist.
}
Is there a way to get list of parameters in Middleware? thanks,
Update: (add Route)
Route::get('test/{page}', array('uses'=>'test@test'));
Laravel version: 5.1.20