how to put variable in view laravel code example Example: laravel pass variables to view return view('home')->with('userName',$userName);