kambuku/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()
    {
       $image_path = Config::whereName('image_dir')->first();
     $thumb_image_path = Config::whereName('thumbnail_image_dir')->first();
     View::share(['image_path' => $image_path, 'thumb_image_path' => $thumb_image_path]);
        view()->composer('*', function($view) {
            $user_details = User::whereId(Auth::user()['id'])->first();
            $country = countries::whereId($user_details['country_id'])->get()->first();
            dd($user_details);
            $view->with(['user_details' => $user_details, 'country' => $country]);
        });
    }
public function boot ( ) { $ image_path = Config :: whereName ( 'image_dir' ) -> first ( ) ; $ thumb_image_path = Config :: whereName ( 'thumbnail_image_dir' ) -> first ( ) ; View :: share ( [ 'image_path' => $ image_path , 'thumb_image_path' => $ thumb_image_path ] ) ; view ( ) -> composer ( '*' , function ( $ view ) { $ user_details = User :: whereId ( Auth :: user ( ) [ 'id' ] ) -> first ( ) ; $ country = countries :: whereId ( $ user_details [ 'country_id' ] ) -> get ( ) -> first ( ) ; $ view -> with ( [ 'user_details' => $ user_details , 'country' => $ country ] ) ; } ) ; }
Bootstrap any application services.
Bootstrap any application services .
// // dd($user_details);