sethbr11
View and ViewAny Permissions
I have a custom menu item on my backend which has this logic for visibility:
I did this so it doesn't show for super admins, who are able to see the actual page with all of the locations. This seems to work, but when I'm in as a role who has view permissions but not viewAny and I click on the menu item, I get a 403 page. I can't seem to figure out why I can't view the location page. This is my location policy:
Eventually I'd want to change this so it restricts it to only being able to view their location, but right now it's just not letting me access the page or any of the locations. Any help here?
1 replies
Any way to change the way the options for the TrashedFilter display?
Instead of them saying "deleted", I want to replace the words with "disabled". I've been able to replace the main label for the filter pretty easily, but I'm not sure what the values for the options are already, and any attempt to just reassign the values of ->options have been unsuccessful so far. I'd prefer to not have to remake it all if possible
4 replies
Filter Not Returning Anything When Nothing is Selected
I am trying to filter my contacts based on what subscription type they have, which is stored in a different table but has foreign key relationships. Here is my code so far:
The main problem has been the
if ($data && isset($data['plan_id']))
line. If I just have if($data)
, it seems to always evaluate to true, even if I don't have a filter option selected, which means the filters themselves work but when nothing is selected nothing shows up. If I try the line as it is in my code, everyone shows up when nothing is selected—even those without a plan, which is what I want—but isset($data['plan_id'])
seems to always evaluate to false, so then the filters don't do anything. I'm pretty new to Filament. Any tips?7 replies