Passing Data To Views: Sharing Data With All Views

<?php

namespace App\Providers;

use Illuminate\Support\Facades\View;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        View::share('key', 'value');
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}

Passing Data To Views: Sharing Data With All Views — Structure map

Clickable & Draggable!

Passing Data To Views: Sharing Data With All Views — Related pages: