{{Session::get('website_name', 'Value Goes Here')}}
php artisan make:middleware SomeMiddleware
Config::get('app.name')
# app/Providers/AppServiceProvider.php
public function boot()
{
// add this
view()->share('someKey', 'This is shared data');
}
public function handle($request, Closure $next)
{
if (!Session::has('website_name')) {
// some logic
Session::put('website_name', 'YOUR VALUE');
}
return $next($request);
}
View::composer('*', function($view)
{
$view->with('website_name', 'My website');
});