Sending multiple value to blade master layouts

Submitted by wasiqaftab - 1 year ago

sending variable values to your multiple controller and accessing them in your blade template

 app('view')->composer(array('layouts.master','layouts.setting'), function($view)
        {
            $action = app('request')->route()->getAction();

            $controller = class_basename($action['controller']);

            list($controller, $action) = explode('@', $controller);

            $view->with(compact('controller', 'action'));
        });
        
        ---
        echo ($controller.'/'.$action.);
comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks