Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

loop data from data base laravel to javascript

how to loop php data in javascript variable
var locations = [
    @foreach ($data as $i)
         [ "{{ $i->name }}  " + "{{ $i->contact_city }}" , {{ $i->lat }},{{ $i->lng }},0, 'https://test.webshooter.se/app/competitions/'+{{ $i->id }}+ '/information'],
         @endforeach         
];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loop #data #data #base #laravel #javascript
ADD COMMENT
Topic
Name
5+5 =