Skip to content
Advertisement

Trying to get property ‘page’ of non-object while using session variable

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

JavaScript

Advertisement

Answer

The error is not from session. the error on this line if ($request->page == null).

The $request->page variable you’re trying to access is not defined.

Try to check empty condition it will check variable is isset or null as well.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement