title: Laravel 7.14 loading social links with for each loop on header
body: <p>I have a datatable for social links. a user can edit the link whenever he wants.</p>
  <p>Just link any other crud it is very simple. I am trying to load all the links in blade view with icons in header of my app. I created as function and added a for each loop in the snippets.</p>
  <p>here's my controller:</p>
  <pre><code>public function socials()
  {
      $socials = Social::all();
  
      return view('inc.subheader')-&gt;with('socials', $socials);
  }
  </code></pre>
  <p>Here's blade snippent:</p>
  <pre><code>&lt;div class=&quot;col-md-3 justify-content-center social-links&quot;&gt;
          &lt;ul class=&quot;nav d-flex justify-content-center&quot;&gt;
              @foreach ($socials as $social)
              &lt;li class=&quot;&quot;&gt;
                  &lt;a href=&quot;{{ $social-&gt;link }}&quot; class=&quot;btn&quot;&gt;&lt;i class=&quot;{{ $social-&gt;icon }} fa-2x&quot;&gt;&lt;/i&gt;&lt;/a&gt;
              &lt;/li&gt;   
              @endforeach
          &lt;/ul&gt;
      &lt;/div&gt;
  </code></pre>
  <p>The error I'm getting is &quot;$socials is undefined&quot; and when I go on localhost/inc/social I only see three dots and no  icons with links.</p>