@ -79,12 +79,18 @@ class LocationController extends Controller
++$duplicates;
++$duplicates;
//update block count for existing item
//update block count for existing item
$location->block_count = $blockcount;
$location->block_count = $blockcount;
//replace null with empty array
if ($location->images == null) {
$location->images = [];
};
$location->save();
$location->save();
} else {
} else {
// make new entries for instances not present
// make new entries for instances not present
if ($item[0] != 'domain') {
if ($item[0] != 'domain') {
++$fresh;
++$fresh;
$new = Location::create([
$images = [];
$new = Location::create([
'uuid' => Uuid::uuid4(),
'uuid' => Uuid::uuid4(),
'name' => $item[0],
'name' => $item[0],
'url' => $item[0],
'url' => $item[0],
@ -93,7 +99,8 @@ class LocationController extends Controller
'rating' => $item[1],
'rating' => $item[1],
'added_by' => 1,
'added_by' => 1,
'tags' => 'poor moderation, hate speech',
'tags' => 'poor moderation, hate speech',
'block_count' => $blockcount
'block_count' => $blockcount,
'images' => $images,
]);
]);
}
}
}
}