laravel how to pass a variable to a view code example
Example 1: laravel pass variables to view
return view('home')->with('userName',$userName);
Example 2: pass parameter to view laravel
Route::get('/', function () {
return view('greeting', ['name' => 'James']);
});