خرید بک لینک

Vote count: 0

I'm trying to redirect my users to the log-in page if the session timeout.

Here is my route

Route::get('/',['as' => 'login', 'uses'=>'AuthController@getSignIn']);

I've tried adding

    if ( $e instanceof IlluminateSessionTokenMismatchException ) {
        retu redirect()->route('login');
    }

in render() in app/Exceptions/Handler.php

    public function render($request, Exception $e)
    {
        if ($e instanceof ModelNotFoundException) {
            $e = new NotFoundHttpException($e->getMessage(), $e);
        }

        if ( $e instanceof IlluminateSessionTokenMismatchException ) {
            retu redirect()->route('login');
        }

        retu parent::render($request, $e);
    }

That doesn't seem to take effect.

How do I implement this in Laravel ?

Any suggestions on this will be much helps !

asked 10 mins ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 6 ارديبهشت 1395 ساعت: 22:01

صفحه بندی