📜  从数据库 laravel 循环数据到 javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:46.188000             🧑  作者: Mango

代码示例1
this is how to loop data to 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         
];