I'm using laravel in my backend and react as my frontend. When I try to pass variables from my controller to the view with this:
public function index()
{
return view('welcome')->with('name', 'San Juan Vacation');
}
And want to retrieve it in my welcome blade file with this:
<p>{{ $name }}</p>
It doesn't work for some reason. It says undefined variable $name. Any idea what might solve this issue?