mardi 9 octobre 2018

Session not passing to the view laravel

I am trying to redirect to a route and pass data and I used with but no go and I also used to just simply set the sessions and then fetch them in the view but no go

Controller code

Session::put(['redirect' => 'student-dashboard', 'user_slug' => $socialUser->slug]);

                return redirect('/register/candidate');

View code

<?php if(\Session::get('redirect')) {

        $redirect = session('redirect');
        echo $redirect;
        die();
    } 
?>  

But it never enters this if check and I need data on this view so any advise on this will be helpful.

Please Note :- Session is available in the controller after being sent and I am using Laravel 5.6



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire