jeudi 16 juin 2016

how to pass data in welcome.blade.php file in laravel 5

i want to pass data to my welcome.blade.php file.but getting error undefined variable.

public function counter(Request $request){

        $user= new User();
        $user_detail= new UserDetails();
        $shop=$user->select('id')->where('user_type',1)->get();
        $count=count($shop);
        return View::make('welcome')->with(['counter'=>$count]);

}

route

Route::get('/counter', [    
            'as'   => 'counter',
            'uses' => 'HomeController@counter'
    ]); 

in view i tried to get data like

what happening wrong. i am new to laravel any help will greatly appriciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire