Hello, in my application, I have two guards wtih two different Models, Admin and User to handle my backend and frontend.
I have Policies on my existing Models for my frontend, though that accept User Model as first parameter of every method. Filament tries to use these Policies (https://filamentphp.com/docs/3.x/panels/resources/getting-started#authorization) but it obviously does not work since the argument passed is an instance of my Admin Model.
What i could do in my policies is to have a condition to check what type of User I have :
if ($user instanceof Admin) { // rules for backend} elseif ($user isntanceof User) { // rules for frontend}
if ($user instanceof Admin) { // rules for backend} elseif ($user isntanceof User) { // rules for frontend}
But i'd rather have distincts Policies in different directories like