laravel 8 pass data to all views code example
Example: laravel pass view with data
return view("blog", ["posts"=>$posts]);
Or:
return view("blog", compact("posts"));
return view("blog", ["posts"=>$posts]);
Or:
return view("blog", compact("posts"));