title: How can I pass my variable to view laravel
body: <p>I get this error: Undefined variable: user (View: ...)</p>
  <pre><code>public function edit(){
      $user = User::where('id', Auth::user()-&gt;id)-&gt;first();
      return view('layouts.app', ['user' =&gt; $user]);
  }
  </code></pre>
  <p>I am trying to user the object in @yield('content') in my view: layouts/app.blade.php</p>
  <pre><code>    &lt;main class=&quot;&quot;&gt;
          @yield('content')
          {{dd($user-&gt;email)}}
  
      &lt;/main&gt;
  </code></pre>