Merhaba,
updateOrCreate olarak bir kullanım yapıldığında içeriğin eklendiğini , güncellendiğini veya işlemin başarılı olduğunu nasıl anlıyorsunuz ?
isDirty() kullanımı yapıyorum
$pCategoryAttributes = IntegrationCategoryAttributes::updateOrCreate(
[
"categoryID" => $category->id,
"pAttributeID" => $categoryAttribute->id
],
[
"pAttributeName" => $categoryAttribute->name,
"pAttributeDisplayName" => $categoryAttribute->displayName,
"pIsRequired" => $categoryAttribute->isRequired,
"pIsVariantable" => $categoryAttribute->isVariantable,
"pDescription" => $categoryAttribute->description
]);
if (!$pCategoryAttributes->isDirty()) {
$pCategoryAttributes->updateTimestamps();
}
Bu değeri hep örnek vermişler. Eğer false dönüyorsa işleminiz başarılıdır yani içerik vardır gibi.