title: Load markers from database in Leaflet
body: <p>In Laravel's view blade I pulled the data from the database and made a table.</p>
  
  <pre><code>&lt;table id="companies" class="table table-bordered"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Companies&lt;/th&gt;
                  &lt;th&gt;Devices&lt;/th&gt;
                  &lt;th&gt;X&lt;/th&gt;
                  &lt;th&gt;Y&lt;/th&gt;
                  &lt;th&gt;Time&lt;/th&gt;
                  &lt;th&gt;Vehicles&lt;/th&gt;
                  &lt;th&gt;Drivers&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;/p&gt;
          &lt;tbody&gt;
          @foreach ($satwork as $row)
  
              &lt;tr&gt;
                  &lt;td&gt;{{ $row -&gt; company_name}}&lt;/td&gt;
                  &lt;td&gt;{{ $row -&gt; device_type}}&lt;/td&gt;
                  &lt;td&gt;{{ $row -&gt; x}}&lt;/td&gt;
                  &lt;td&gt;{{ $row -&gt; y}}&lt;/td&gt;
                  &lt;td&gt;{{ $row -&gt; datetime}}&lt;/td&gt;
                  &lt;td&gt;{{ $row -&gt; license_plate}}&lt;/td&gt;
                  &lt;td&gt;{{ $row -&gt; driver_name}}&lt;/td&gt;
              &lt;/tr&gt;
              @endforeach
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>In Leaflet I have code that pulling data from DB via that table, and show it on map.</p>
  
  <pre><code>var koordinate = {!! json_encode($device-&gt;toArray()) !!};
      console.log(koordinate);
  
      for (var i=0; i &lt; koordinate.length; i++) {
          if(koordinate[i].x &amp;&amp; koordinate[i].y){
          var marker = L.marker([koordinate[i].x, koordinate[i].y])
          .bindPopup("Device: "+koordinate[i].device_type+'&lt;br&gt;' + "Time: "+koordinate[i].time)
  
          .addTo(map);
          }
      }
  </code></pre>
  
  <p>I need a way how to pull all the data directly from the database to Leaflet, without contact with view blade. Is that even posible? </p>