Set table to use for filament resource
I am trying to use Filament with Laravel Permissions and have run into an issue. I set the model relationship manually
protected static ?string $model = Model_Has_Roles::class;
as that's what the table is called. However when I try to access it I get the following error:
It seems Filament added an additional _
between each word as it should be model_has_roles
. I tried to search the documentation but, didn't find anything at the time. Could someone please steer me in the right direction?8 Replies
In the model class try putting
As you can see, the project is trying to access .
Uh, it's still stuck, it seems the model_has_roles table doesn't have an
id
column.
More bad news π΅βπ«
Without any code I can't help you. What are you trying to do exactly?
if thats the pivot table of a many to many relation, do you have the relations well defined?
do you have a model called model?
it's a polymorphic?
Just create a simple resource to the model_has_roles table which is what Laravel Permission (https://spatie.be/docs/laravel-permission/v6/introduction) uses to assign roles to users
Introduction | laravel-permission
laravel-permission
No idea, I am using the default configuration of Laravel Permission
I never used that package, I can't help further.
Ok thanks anyways