Missing Bulk Operation (ARCH7053)
هذا المحتوى غير متوفر بلغتك بعد.
Key php.orm.missing-bulk-operation · Severity warning · Category orm
Repeating single-row operations in a loop when a bulk/batch API exists (insert, createMany, upsert) is wasteful. Collapsing to one bulk call drastically reduces round-trips.
Incorrect
Section titled “Incorrect”<?phpforeach ($items as $item) { Product::create(['sku' => $item['sku']]); // one INSERT per row}Correct
Section titled “Correct”<?php$payload = array_map(fn($i) => ['sku' => $i['sku']], $items);Product::insert($payload); // single bulk INSERTCollapse the repeated single-row operations into a bulk API like insert/createMany.