About passing data from the controller to the screen

Passing data from the controller that displays the screen to the screen to display

Error message

I get the error $name is undefined.

Applicable source code
Controller code
public function registUser (Request $request) {
        / *
         Perform registration processing in the database
        * /
        return view ('home')->with ('name', $request->only ('name'));
Component code used for the display screen
     @if (true == true)
Source code
Supplemental information (FW/tool version etc.)

Development environment OS Windows10
Editer Visual Studio Code
laravel version 6.3.0