1# app/Providers/AppServiceProvider.php
2
3public function boot()
4{
5 // add this
6 view()->share('someKey', 'This is shared data');
7}
1public function handle($request, Closure $next)
2{
3 if (!Session::has('website_name')) {
4 // some logic
5 Session::put('website_name', 'YOUR VALUE');
6 }
7
8 return $next($request);
9}
10
1View::composer('*', function($view)
2{
3 $view->with('website_name', 'My website');
4});
5