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()
    {
        Schema::defaultStringLength(191);
        view()->composer('*', function(){
            $menusHeader = Menu::withParent(0)->visible()->position('header')->orderBy('priority', 'asc')->get();
            view()->share('menusHeader', $menusHeader);
            $menusFooter = Menu::withParent(0)->visible()->position('footer')->orderBy('priority', 'asc')->get();
            view()->share('menusFooter', $menusFooter);
            $imagesFooters = Product::limit(9)->orderBy('id','desc')->get();
            view()->share('imagesFooters', $imagesFooters);
        });
    }
public function boot ( ) { Schema :: defaultStringLength ( 191 ) ; view ( ) -> composer ( '*' , function ( ) { $ menusHeader = Menu :: withParent ( 0 ) -> visible ( ) -> position ( 'header' ) -> orderBy ( 'priority' , 'asc' ) -> get ( ) ; view ( ) -> share ( 'menusHeader' , $ menusHeader ) ; $ menusFooter = Menu :: withParent ( 0 ) -> visible ( ) -> position ( 'footer' ) -> orderBy ( 'priority' , 'asc' ) -> get ( ) ; view ( ) -> share ( 'menusFooter' , $ menusFooter ) ; $ imagesFooters = Product :: limit ( 9 ) -> orderBy ( 'id' , 'desc' ) -> get ( ) ; view ( ) -> share ( 'imagesFooters' , $ imagesFooters ) ; } ) ; }
Bootstrap any application services.
Bootstrap any application services .