title: Site map generator in laravel 5 with RoumenDianoff sitemap
body: <p>Im implementing the laravel RoumenDianoff Sitemap in my application</p>
  
  <p><a href="https://github.com/RoumenDamianoff/laravel-sitemap/wiki/Dynamic-sitemap" rel="nofollow">https://github.com/RoumenDamianoff/laravel-sitemap/wiki/Dynamic-sitemap</a></p>
  
  <p>And im really confused on this part of the code</p>
  
  <pre><code>Route::get('sitemap', function(){
  
  // create new sitemap object
  $sitemap = App::make("sitemap");
  
  // set cache key (string), duration in minutes (Carbon|Datetime|int), turn on/off (boolean)
  
  $sitemap-&gt;setCache('laravel.sitemap', 60);
  
  $posts = DB::table('posts')-&gt;orderBy('created_at', 'desc')-&gt;get();
  
  
       foreach ($posts as $post)
       {
          $sitemap-&gt;add($post-&gt;slug, $post-&gt;modified, $post-&gt;priority, $post-&gt;freq);
       }
  </code></pre>
  
  <p>As I understand i'm creating a route to use  sitemap as that function so the part I don't get is when do I iterate trough every link of my website, or how do i get this links from my website to add then to the for each on that function, i mean it looks like that $posts variable but I don't have record of my links on any database so how can i get this links. </p>