chiiya / filament-access-control

Admin user, role and permission management for Laravel Filament
MIT License
192 stars 24 forks source link

Cannot Create User On Filament Admin #36

Closed itsbreadd closed 1 year ago

itsbreadd commented 1 year ago

When creating users through the filament form in the admin panel, you cannot create a new user unless you assign them no role. You have to save the user without, then edit the role after save.

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'model_id' cannot be null (Connection: mysql, SQL: insert into `model_has_roles` (`model_id`, `model_type`, `role_id`) values (?, Chiiya\FilamentAccessControl\Models\FilamentUser, 2))
DoniyorSamandarov commented 1 year ago

@itsbreadd you found solve this to issue?

reaboivictor commented 1 year ago

Hi, I was struggling with this too.

I am not sure if filament introduced a bug, but it might be related to it because I got the error with filament/filament v2.17.32 but after downgrading it to filament/filament v2.17.21 (this is what we are using on another project where everything works) the error was gone.

I am open to helping with research if someone can assist and give some ideas on what needs to be done next in order to identify where the problem is and how can we solve it faster.

chiiya commented 1 year ago

Hey, sorry it took me some time to look at this.

Should be fixed in 1.7.1