jeudi 28 décembre 2017

Laravel view share wont work

I have the following class

use Illuminate\Support\Facades\View;


class WebUser

{


    public function __construct()
    {

        $status = (object) [
            'isLogin' => (Session::get('token')? true : false),
            'isSubscribed' => $this->isSubscribed(),
            'isPlatinum' => $this->isPlatinum(),
            'isExpired' => $this->isExpired()
        ];

        View::share('thisUser',$status);

    }

This class will run after user is successfully signed in.

I tried to view the shared variable in view file , giving error

Undefined variable: thisUser (View: 



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2C6A0Pe
via IFTTT

Aucun commentaire:

Enregistrer un commentaire