Closed kaktusss closed 1 year ago
Hey @kaktusss! We're sorry to hear that you've hit this issue. 💛
However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?
We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.
Package
filament/notifications
Package Version
v3
Laravel Version
v10
Livewire Version
No response
PHP Version
PHP 8.1
Problem description
MariaDB is incompatible with the json arrow '->' operator: https://github.com/filamentphp/filament/blob/a3a4cf2a66e26c2553613cff1ecdecd77f7352f5/packages/notifications/src/Livewire/DatabaseNotifications.php#L88 The query returns no result because of that.
Expected behavior
Here is the fix using JSON_EXTRACT:
return $this->getUser()->notifications()->whereRaw('JSON_UNQUOTE(JSON_EXTRACT(data,\'$.format\')) = "filament"');
Steps to reproduce
Reproduction repository
https://github.com/filamentphp/filament/pull/8305
Relevant log output
No response