my web.php
Route::get('/index',function()
{
$count_total = DB::table('vendors')->count('id');
return $count_total;
});
in my index.blade.php
<h3> </h3>
<p>Vendors</p>
Do this
Route::get('/index',function()
{
$count_total = DB::table('vendors')->count('id');
return view('index',compact('count_total'));
});
Then In your index.blade.php
<h3> {{$count_total}} </h3>
<p>Vendors</p>