I have an array of products and I used Chunk in laravel , as the following to save these products , however , I want to add these products as Product Objects or at least get their id , how to do that
$recordChunks = array_chunk($records, parent::CHUNK_SIZE);
foreach($recordChunks as $chunk) {
self::insert($chunk);
}