2 months ago

Redirecting an Error to a 404!

Posted 2 months ago by Randy_Johnson

Hi, when ever I leave the computer and the user is logged in, over a certain amount of time the user is logged out (of course, we all know, I'm sorry!). When this happens I refresh the page and I get the error:

Trying to get property 'is_admin' of non-object

The error isn't the problem, it is the showing of the error which I want to rid. I went into the code and tried putting an else statement as so:


@if(auth()->user()->is_admin == 1)
@elseif(auth()->user()->is_admin == 0)


Please help!

Please sign in or create an account to participate in this conversation.