i have a homeController function , I would like to pass multiple variables from this controller function to all views, not just the welcome view
class HomeStatsController extends Controller
{
public function datacases()
{
// $malades=DB::table('stats')->first();
// $malades = DB::table('stats')->where('date', '=', DATE(now()));
$maj = DB::table('stats')->orderBy('id', 'desc')->value('created_at');
$malades = DB::table('stats')->whereDate('date', \Carbon\Carbon::today())->get()->sum('nbrmal');
$guerris= DB::table('stats')->whereDate('date', \Carbon\Carbon::today())->get()->sum('nbrgue');
$morts = DB::table('stats')->whereDate('date', \Carbon\Carbon::today())->get()->sum('nbrmort');
$maladestotal = DB::table('stats')->get()->sum('nbrmal');
$guerristotal = DB::table('stats')->sum('nbrgue');
$mortstotal = DB::table('stats')->sum('nbrmort');
$publications = DB::table('informations')->orderBy('created_at', 'desc')->limit(3)->get();
return view('welcome',compact('malades','maj','guerris','morts', 'maladestotal', 'guerristotal', 'mortstotal','publications'));
} }