How can I ensure that only authorized people can see this Package in the Menu?
https://github.com/filipfonal/filament-log-manager
I'm trying to write a policy, but it didn't work because there was no model. Can you help me ?
GitHub
GitHub - filipfonal/filament-log-manager: A simple and clear interf...
A simple and clear interface to preview, download and delete Laravel log files using Filament Admin. - GitHub - filipfonal/filament-log-manager: A simple and clear interface to preview, download an...
14 Replies
you have to overwrite the page from the config
and add your authorization to it
https://github.com/filipfonal/filament-log-manager/issues/4#event-8172858929
GitHub
Feature Request: Way to add authorization? · Issue #4 · filipfonal/...
I think it would be great to have way to add authorization to the log manager page. Alternatively (or additionally) it could be nice to be able to set the page class FQCN in config, that way the pa...
I'm not sure exactly how to do this. Can I solve this problem with middleware or another method?
dont think its possible with middleware
it's normal filament page
just create a filament page in your app with the command
make it extend
Logs::class
from the package
set it in the package config
add the canAccess
I'm doing it this way, but am I on the right track?
yes this should work
It still didn't work, am I making a mistake somewhere?
what exactly didnt work?
from your screenshot now the page should not appear in the sidebar
Frankly, I don't understand if I'm extending it in the wrong way.
did a q test its working with me 🙂
It's very interesting indeed. Is it possible to send the test project to me?
I just install it in my demo app to test
you have shield installed?
filament shield
No I don't install shield
I noticed the role in the menu
I think you have something overwrite the canAccesee
I haven't installed it yet, I'm thinking of installing spatie permission. That's why I created