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