protected function composeViews()
    {
        // user menu in app
        View::composer('app', function ($view) {
            $view->getFactory()->inject('account', view('user::menu', ['guest' => Auth::guest(), 'user' => Auth::user()]));
        });

        View::composer('admin', function ($view) {
            // user menu in admin menu
            $view->getFactory()->inject('account', view('user::admin.partials.account', ['user' => Auth::user()]));

            // user panel in admin sidebar
            $view->getFactory()->inject('userpanel', view('user::admin.partials.userpanel', ['user' => Auth::user()]));
        });
    }
protected function composeViews()
    {
        // user menu in app
        View::composer('app', function ($view) {
            $view->getFactory()->inject('account', view('user::menu', ['guest' => Auth::guest(), 'user' => Auth::user()]));
        });

        View::composer('admin', function ($view) {
            // user menu in admin menu
            $view->getFactory()->inject('account', view('user::admin.partials.account', ['user' => Auth::user()]));

            // user panel in admin sidebar
            $view->getFactory()->inject('userpanel', view('user::admin.partials.userpanel', ['user' => Auth::user()]));
        });
    }
protected function composeViews ( ) { // user menu in app View :: composer ( 'app' , function ( $ view ) { $ view -> getFactory ( ) -> inject ( 'account' , view ( 'user::menu' , [ 'guest' => Auth :: guest ( ) , 'user' => Auth :: user ( ) ] ) ) ; } ) ; View :: composer ( 'admin' , function ( $ view ) { // user menu in admin menu $ view -> getFactory ( ) -> inject ( 'account' , view ( 'user::admin.partials.account' , [ 'user' => Auth :: user ( ) ] ) ) ; // user panel in admin sidebar $ view -> getFactory ( ) -> inject ( 'userpanel' , view ( 'user::admin.partials.userpanel' , [ 'user' => Auth :: user ( ) ] ) ) ; } ) ; }
composes admin views.
composes admin views .