jeudi 26 mai 2016

Error opening Laravel project after 30 minutes

I am getting errors when reloading the previously opened tab of my Laravel Project on my browser. There is no error on the page, I mean it loads correctly when I opened it half hour ago.

It shows this error.

The error says "Trying to get property of non-object"

4/4 ErrorException
Trying to get property of non-object 
(View: C:\xampp\htdocs\demo\resources\views\partials\mainheader.blade.php)
(View: C:\xampp\htdocs\demo\resources\views\partials\mainheader.blade.php)
(View: C:\xampp\htdocs\demo\resources\views\partials\mainheader.blade.php) 

ADDED: Only suspicious code that might be causing problem on mainheader.blade.php is, I am using . But I am still confuse how I can Redirect this exception. What I thought was, it was due to error in session and token expiration, so I added this code to app/Exception/handler.php

if ($e instanceof \Illuminate\Session\TokenMismatchException) {            
    return redirect('error/403')->withErrors(['token_error' => 'Sorry, your session seems to have expired. Please try again.']);
}

But, that was not solved. Could you please so me the right way?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire