pxlrbt / filament-excel

Excel Export for Filament Admin Resources
MIT License
323 stars 68 forks source link

[Bug] use uuid instead of id as primary key error #189

Open C0d9Hunter opened 3 months ago

C0d9Hunter commented 3 months ago

I'm working on a laravel v10 project, filament v3. My producer model defined as such:

when I try to export I get this error on the image

filament export error

error in English: SQLSTATE[42883]: Undefined function: 7 ERROR: operator doesn't exist: text = integer LINE 1: select * from "posts" where "posts". "uuid" in (0) order by "... ^ HINT: No operator matches the given name and argument types.

pxlrbt commented 3 months ago

I don't really see the issue here. You say "Producer Model" but this is an error for "posts"? If your Model has a uuid column, then the query would be correct, right?

C0d9Hunter commented 3 months ago

Sorry, on my project it's the Model Producer, I got the error on this project and thought I must have made a mistake, so I quickly created another laravel project with the Model Post.

Observation: when the primary key is ID the export goes fine, but when I change it to a uuid I get this error. It's as if the request expects to receive an integer (Id), but a string (UUID) is passed.