Conoslidate external URLs for a place into a single JSON column
This commit is contained in:
parent
3d734201a2
commit
8ae5d4e770
6 changed files with 63 additions and 22 deletions
|
@ -47,7 +47,11 @@ class PlaceService
|
|||
{
|
||||
//check if the place exists if from swarm
|
||||
if (array_key_exists('url', $checkin['properties']) && ends_with(parse_url($checkin['properties']['url'][0], PHP_URL_HOST), 'foursquare.com')) {
|
||||
$place = Place::where('foursquare', $checkin['properties']['url'][0])->get();
|
||||
$place = Place::where(
|
||||
'external_urls',
|
||||
'@>',
|
||||
json_encode('foursquare' => $checkin['properties']['url'][0]
|
||||
)->get();
|
||||
if (count($place) === 1) {
|
||||
return $place->first();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue