kambuku/app/Providers/BottomHeaderProvider.php
/**
     * Bootstrap the application services.
     *
     * @return void
     */
Bootstrap the application services.
@return void
Bootstrap the application services . @return void
public function boot()
    {
        view()->composer('partials.bottom_header', function($view){
            $user_id = Auth::user()['id'];
            $messages = messagereceivers::whereuser_id($user_id)
                    ->whereRead_status('0')
                    ->get()
                    ->count();
            dd($messages);
            if ($messages > 0)
            {
                $view->with('message_count', $messages);
            }else{
                $view;
            }
        });
    }
public function boot ( ) { view ( ) -> composer ( 'partials.bottom_header' , function ( $ view ) { $ user_id = Auth :: user ( ) [ 'id' ] ; $ messages = messagereceivers :: whereuser_id ( $ user_id ) -> whereRead_status ( '0' ) -> get ( ) -> count ( ) ; if ( $ messages > 0 ) { $ view -> with ( 'message_count' , $ messages ) ; } else { $ view ; } } ) ; }
Bootstrap the application services.
Bootstrap the application services .
// //dd($messages);