Laravel can only pass data to a view/template; JavaScript files are loaded externally and therefore App data is not passed to them Laravel blade.
There is no way to use Blade templating within an external JavaScript file. In order to get around this, you need to create <script>
tags within your Blade template file.
{{-- Code in your template file, e.g., view.blade.php --}}
<script type="text/javascript">
// Put all locations into array
var locations = [
@foreach ($articles as $article)
[ "{{ $article->lat }}", "{{ $article->lng }}" ],
@endforeach
];
// NOTE: I've added a comma which will be needed to delimit each array within the array.
// Quotes will also be needed since lat and long are not integers.
</script>