Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting Upsert only insert and doesnt update #275

Closed
chimuel-jlc opened this issue Jun 12, 2024 · 1 comment
Closed

Setting Upsert only insert and doesnt update #275

chimuel-jlc opened this issue Jun 12, 2024 · 1 comment

Comments

@chimuel-jlc
Copy link

chimuel-jlc commented Jun 12, 2024

Laravel 11 bug caused by upsert to only insert and not update settings on line #76 on file /src/SettingsRepositories/DatabaseSettingsRepository.php

Propose fixed:

public function updatePropertiesPayload(string $group, array $properties): void
{
    $model = $this->getBuilder();
    $propertiesInBatch = collect($properties)->map(function ($payload, $name) use ($group, $model) {
        $model->updateOrCreate(
            [
                 'group' => $group,
                 'name' => $name,
            ],
            [
                'group' => $group,
                'name' => $name,
                'payload' => $encoder($payload),
            ]
        );
    });
}
@rubenvanassche
Copy link
Member

As far as I'm aware all our tests are running fine even on Laravel 11? Could you be more specific what's exactly broken? Gonna close this for now but feel free to answer and I'll take a further look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants