Plugin with Auth that registers: Pages, Widgets, and Resources

I'm creating a plugin for the registration of modules. How do I get the authenticated user on the plugin? I already tried the following: auth()->check() Auth::check() Filament::getTenant() These gave null and false Thank you
No description
2 Replies
Andrew Wallo
Andrew Wallo12mo ago
The authenticated User probably can't be evaluated at the time in the lifecycle since everything there happens while the application is being scaffolded/booted. So you may need to find another location. Maybe in a middleware, event/listener, etc.
Michael Mamaclay
Michael MamaclayOP12mo ago
Here's my code where I add the discover of my modules. This is from the Provider/FIlament/AdminPanelProvider.php
No description
Want results from more Discord servers?
Add your server