laravle pass data with view 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"));