Model Policy is loading in filament resource and breaking
Filament is loading my ClientPolicy when going to my Client Resource and its not passing the Client model as a second parameter.
I do not understand why its loading the ClientPolicy in the first place?
I'm not even going to the Create resource route but that is where the error is.
Its not passing the Client model as the second parameter, Not sure why?
3 Replies
Is it in the list page? Do you have any actions in that page? Policies are used in various places - eg the
viewAny
is used to check if a person has access to the list page etc
You can disable most of them but without any details I can't be more specific.
But yeah, this is expected behaviourProblem is Create Policy was expecting a User and a Client, So I had to remove Client and use Store Policy for saving and not Create. No idea why it won't just pass User and Client to the Create Policy method.
Filament is loading my ClientPolicy when going to my Client Resource and its not passing the Client model as a second parameter.How should we pass a Client when that one isn't created yet? 🤔 The
create()
method should only require a User