app/Providers/AppServiceProvider.php
/**
     * Bootstrap any application services.
     *
     * @return void
     */
Bootstrap any application services.
@return void
Bootstrap any application services . @return void
public function boot()
    {
        $users = User::with('roles')->get();
        $roles = Role::with('users','permissions')->get();
        View::share(array('users'=>$users));
        View::share(array('roles'=>$roles));
    }
public function boot ( ) { $ users = User :: with ( 'roles' ) -> get ( ) ; $ roles = Role :: with ( 'users' , 'permissions' ) -> get ( ) ; View :: share ( array ( 'users' => $ users ) ) ; View :: share ( array ( 'roles' => $ roles ) ) ; }
Bootstrap any application services.
Bootstrap any application services .