Skip to content

Create array dynamically for javascript

I am trying to show markers on google map. And it is working fine if I use static array for marker’s lat and long. But when I try to make dynamic using php array, then it is not working. Here is the code. I want following array in above code to be dynamic For that I am using following code

Eloquent relationship where not in sub-query

I have got a relationship where I select all row’s based on the category, however I need to exclude some of these if they are within a sub query. So above is my code, nearly works as I want it, however it seems that the $q variable doesn’t have the table name within the query, below is the query o…

Get Laravel route with optional parameter

I was wondering if it’s possible to get the full url/path in Laravel with a optional parameter in it. In web.php I have this: And want to get the full url/path with this: But only ‘var1’ appears. How come? In the manual there are no examples. Answer The parameters should be in an array like: