Closed rabol closed 1 month ago
I cloned your repo but this is the migration:
$table->integer('user_level')->default(0);
it's not an enum
On the model it’s casted to a enum, how would you otherwise do it?
it works in all other parts of the app
You could use the enum
function of a migration.
IMHO seems more an enhancement, instead of a bug.
Filament gets database schema to create the list and the form. It does not check the laravel casts.
a boolean work even if it stored in the db as an int
This isn't a bug if the column is an integer in the database indeed.
Package
filament/filament
Package Version
v3.2.76
Laravel Version
v11.7.0
Livewire Version
No response
PHP Version
v8.3.6
Problem description
If you have a column on your model that is of type enum then the generated code by
php artisan make:filament-resource UserResource -G
is not correct.this is generated
Expected behavior
That the code generated is valid and working.
Steps to reproduce
Use the repo, login select the users
Reproduction repository
https://github.com/rabol/filament-bug
Relevant log output
No response