Repeater MorphToMany
Hi everyone!
I'm having a rough time with managing a MorphToMany relationship with a repeater. I'm currently managing permissions, roles and users.
Model/Permission.php
Model/User.php:
Model/Role.php:
Logic works fine, except the Repeater. I followed this documentation: https://filamentphp.com/docs/3.x/forms/fields/repeater#integrating-with-a-belongstomany-eloquent-relationship
and created the pivot class:
and in Model/Permission.php:
1 Reply
Then in my PermissionResource I have:
But when I try to save I get this error:
SQLSTATE[HY000]: General error: 1364 Field 'grantable_type' doesn't have a default value
which I think it means that it cannot manage the grantable_type column with the path to the model.
Any idea how to solve? Thanks everyone