Data::insert([
'type' => $node->type,
]);
$dataToInsert=[];
$strings = 0;
for ($i=0; $i<count($data->offer); $i++) {
$item=$data->offer[$i];
$dataToInsert[$strings]=[
'type' => $item->type,
'property-type' => $item->{'property-type'},
'category' => $item->category,
'url' => $item->url,
'country' => $item->location->country,
'locality-name' => $item->location->{'locality-name'},
'address' => $item->location->address,
'price-value' => $item->price->value,
'price-currency' => $item->price->currency,
'organization' => $item->{'sales-agent'}->organization,
'floor' => $item->floor,
'area-value' => $item->area->value,
'area-unit' => $item->area->unit,
'building-name' => $item->{'building-name'},
'image' => $item->image,
'feed_id' => $feed_id,
];
$strings++;
if($strings == 400){
Data::insert($dataToInsert);
$strings = 0;
$dataToInsert = [];
}
}
Data::insert($dataToInsert);
$id = implode(",", $request->all());
$data = Specialnosti::whereIn('univer_id', [$id])->get();