foreach ($items as $item) {
$carObj = new Car();
$carObj->id = $item['id'];
$carObj->make = $item['make'];
$carObj->model = $item['model'];
$carObj->price = $item['price'];
$carObj->href = $item['href'];
$carObj->year = $item['year'];
$carObj->created = $item['created'];
$carObj->save();
}
Как не записывать запись, если такой id уже существует?
try {
$carObj = new Car();
$carObj->id = $item['id'];
$carObj->make = $item['make'];
$carObj->model = $item['model'];
$carObj->price = $item['price'];
$carObj->href = $item['href'];
$carObj->year = $item['year'];
$carObj->created = $item['created'];
$carObj->save();
} catch (Illuminate\Database\QueryException $e) {
/* nothing */
}