You have to write your controller method like this way using "compact"
public function getDashboard() {
$posts = Post::all();
return view('dashboard', compact('posts'));
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community