This question already has an answer here:
Allright,
Here is my index()
method of UserController
public function index()
{
$name = 'echoashu';
return view('home', compact('name'));
}
As simple as that, and here my home.blade.php
code
<span class="info-box-number">{{$name}} </span>
This must work ideally as per documentation, but it returns undefined variable error
Undefined variable: name (View: C:\xampp\htdocs\laravel1esources\views\home.blade.php)
Any guess??
</div>