How do you pass dynamic data to all views in Laravel?
For this you have to get value & assign value in controller file in __construct() like this.
BY Best Interview Question ON 07 May 2020
Example
public function __construct() {
$this->middleware(function ($request, $next) {
$name = session()->get('businessinfo.name'); // get value from session
View::share('user_name', $name); // set value for all View
View::share('user_email', session()->get('businessinfo.email'));
return $next($request);
});
}