Dynamic nav laravel 5.3
<p>I'm building a navigation similar to wordpress basically what I want to do is add the navigation dynamically. my code in the header.blade.php looks something like:</p>

<pre><code>@foreach($nav as $navs)

&lt;li&gt;&lt;a&gt;$navs-&gt;title&lt;/a&gt;&lt;/li&gt;

@endforeach
</code></pre>

<p>I will like the links to display in all my pages but I'm not sure how to set this in the route. Please any suggestion would be really helpful. 
I'm still new to Laravel.</p>

<p>Sorry for not explaining properly, what I actually want is:</p>

<p>Once I add the navigation links and the details, it should display something like this</p>

<p>localhost/about-us</p>

<p>localhost/contact-us </p>

<p>So far I have got all the details and slug in the db.</p>

<p>e.g Controller to get all pages</p>

<pre><code>class NavController extends Controller
  {
       public function nav()
         {
            $navs=Page::all();
            return view('themes.first.header')-&gt;withNavs($navs);    
         }
      }
</code></pre>

<p>e.g header.blade looks something like this</p>

<pre><code>     @foreach($navs as $nav)
      &lt;li&gt;&lt;a href=""&gt;$nav-&gt;title&lt;/a&gt;&lt;/a&gt;&lt;/li&gt;
     @endforeach
</code></pre>

<p>The header is included on every page in master.blade so my issue is</p>

<p>for example I go localhost/blog</p>

<p>The links doesn't display  but if I add route like this</p>

<pre><code>   Route::get('nav','NavController@nav');
</code></pre>

<p>Then go to /nav then it works fine. but I want something like this</p>

<p>localhost/about-us </p>

<p>and also for the links to display on every page. I hopefully I have explained properly now if not just let me know.</p>

<p>Please ignore suggesting code for the href="" because I've already done all that bit in my other pages etc so I know how to handle the code for the href, the part that I'm having issues is just with the navigation links not showing on all the pages. </p>

<p>Finally got the navigation working by using the suggestion from this thread
<a href="https://stackoverflow.com/questions/32417795/proper-way-to-make-a-dynamic-navigation-in-laravel-5">Proper way to make a dynamic navigation in Laravel 5</a></p>