I am trying to put $request in the session variable but when I try to get in the controller its showing error Trying to get property 'page' of non-object.
code below
Session::put('request', $request->all());
if ($request->page == null) {
Session::put('key', $request->all());
}