FilamentF
Filament2y ago
Andi

Import update if exists not working with database driver

Hi guys

I'm on Filament v3.2.34, so latest release.

When using sync queue driver, the record gets updated, but as soon as I use the database driver, there is always a new record created.

This is my code:
public function resolveRecord(): ?Sale
    {
        return Sale::firstOrNew([
            'shop_id' => $this->options['shop_id'],
            'sales_date' => $this->data['sales_date'],
        ]);
    }


Do you guys know a workaround or is it a bug?
Solution
....
it was the global scope which interefered.
Was this page helpful?