Level 104
Are visibility_id and visibility_type fillable attributes on the Model?
Not sure what's going on here but the updateOrCreate method doesn't seem to merge the two arrays.
Am I missing something obvious here?
public function updatedProperties(bool $value, string $key): void
{
$index = (int) Str::of($key)->explode('.')->first();
$property = $this->properties->get($index);
$upsert = [
'visibility_id' => $property->id,
'visibility_type' => VisibilityTypes::PROPERTY,
];
GlobalVisibility::updateOrCreate($upsert, ['is_visible' => $value]);
}
SQLSTATE[HY000]: General error: 1364 Field 'visibility_id' doesn't have a default value (Connection: lvr, SQL: insert into `global_visibilities` (`is_visible`, `updated_at`, `created_at`) values (0, 2023-06-02 10:16:08, 2023-06-02 10:16:08))
Are visibility_id and visibility_type fillable attributes on the Model?
Please or to participate in this conversation.