When a place already exists, return an instance of that place, not a collection of length 1
This commit is contained in:
parent
42a0f7c6c3
commit
3d734201a2
1 changed files with 1 additions and 1 deletions
|
@ -49,7 +49,7 @@ class PlaceService
|
|||
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();
|
||||
if (count($place) === 1) {
|
||||
return $place;
|
||||
return $place->first();
|
||||
}
|
||||
}
|
||||
if (array_key_exists('name', $checkin['properties']) === false) {
|
||||
|
|
Loading…
Add table
Reference in a new issue