Closed khanakia closed 1 year ago
Can you please pinpoint exactly which release between .14 and .19 caused it?
I have mentioned it already ^3.0-stable (v3.0.19)
:hushed:
You mentioned that it worked when you downgraded to .14, did you try .18? I don't see any changes to the select component that were made in .19
I downgraded to .14
because i saw it was working on the filament demo repo https://github.com/filamentphp/demo/tree/main/app/Filament which uses the .14
So i wanted to make sure that bug exists in the latest version only.
Also i shared a minimal repo to reproduce the issue here: https://github.com/khanakia/filament_selectnull
PS: Also checked on "filament/filament": "v3.0.18"
same issue persist
I just checked
I just digged further this commit created the issue
https://github.com/filamentphp/filament/commit/6dcb86ce81cafb82f2c82fd06cd4f802143e64fc?diff=unified
Found the issue. Your column isn't $fillable
.
I see I thought Model::unguard();
will simply make all the fields fillable.
Can we add this somewhere in docs like to define $fillable
for select when it is nullable
so it will save time for anyone having the same situation 😄
Model::unguard();
should also work
Package
filament/filament
Package Version
^3.0-stable (v3.0.19)
Laravel Version
10.18.0
Livewire Version
v3
PHP Version
PHP 8.2
Problem description
Check the Dsicussion https://github.com/filamentphp/filament/discussions/7712
Hello,
this is what i have as you can see state_id is nullable and when i clear the select field and saving does not works Note these points i have checked already
update "tax_rates" set "rate" = ?, "updated_at" = ? where "id" = ? ["35.001","2023-08-13 08:13:44",2]
Note: I am using Postgres as my database
Expected behavior
It should send
stated_id=null
also in the update querySteps to reproduce
I have created a demo reproducible repo also here https://github.com/khanakia/filament_selectnull
It contains very minimal code just to reproduce the issue in MYSQL also.
How to run
.env
andfilament_selectnulldb.sql
files within the root directoryphp artisan serve
admin@admin.com
and pass:admin
Here's the attached video:
https://github.com/filamentphp/filament/assets/2174170/6b1a45b0-bba4-4443-bcf6-a5b7dbcc9f28
Reproduction repository
https://github.com/khanakia/filament_selectnull
Relevant log output
This bug only exists in the newer version ^3.0-stable (v3.0.19)
I was testing the filament demo main repo and I just downgraded to the same version as demo repo v3.0.14 to my repo and it worked.