feat(website-extras): enhance toggle functionality and update related tests; add additional info configuration to tenant extras
This commit is contained in:
@@ -174,7 +174,15 @@ class WebsiteExtraService
|
||||
$websiteExtra = $tenant->websiteExtras()
|
||||
->where('website_type_extra_id', $definition->id)
|
||||
->lockForUpdate()
|
||||
->firstOrFail();
|
||||
->first();
|
||||
|
||||
if (! $websiteExtra) {
|
||||
return $tenant->websiteExtras()->create([
|
||||
'website_type_extra_id' => $definition->id,
|
||||
'config' => [],
|
||||
'is_enabled' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$websiteExtra->update([
|
||||
'is_enabled' => ! $websiteExtra->is_enabled,
|
||||
|
||||
Reference in New Issue
Block a user