Sending multiple value to blade master layouts

Submitted by wasiqaftab - 9 years 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.);