Skip to content

Instantly share code, notes, and snippets.

@KristofferTolboll2
Created March 3, 2023 14:01
Show Gist options
  • Select an option

  • Save KristofferTolboll2/a8593871127f492266d2dfe7fa549f59 to your computer and use it in GitHub Desktop.

Select an option

Save KristofferTolboll2/a8593871127f492266d2dfe7fa549f59 to your computer and use it in GitHub Desktop.
$productData = [...]
class ProductSeeder extends Seeder {
public function run() {
foreach($productData as $product){
Product::createOrUpdate([
'name' => $productData['name']
'price' => ...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment