outer-web / image-library

MIT License
7 stars 1 forks source link

Doesn't work with SQLite #3

Closed pMatt1988 closed 7 months ago

pMatt1988 commented 7 months ago

Laravel 11 is shipping with SQLite by default now and it seems that image-library does not work with SQLite. I get an error that the FIELD() function does not exist when trying to upload a new image, I was able to solve this by switching to a MySQL database.

SimonBroekaert commented 7 months ago

Hi @pMatt1988,

You are probably using the Filament package that uses this package? As only the filament package uses a ->orderByRaw('FIELD(id, ' . implode(',', $state) . ')').

I will try to solve this issue for you.

Thank you for notifying me!

SimonBroekaert commented 7 months ago

Hi @pMatt1988 ,

The issue is now resolved by using another way to order the images in the query. The new way is supported by all major DB drivers.

You can use the solution by upgrading to v2.4.0

See the changelog of the filament-image-library as the issue is only present in the filament plugin.

I will mark this as solved, but feel free te re-open if needed!