F
Filament15mo ago
Jay

How do I check the current route the user is on?

This used to work previously, but stopped after I ran composer update. if (request()->route()->getName() == 'filament.admin.resources.courses.view') { return [ RelationManagers\PreferencesRelationManager::class, ]; } else { return []; } It says "Call to a member function getName() on null"
Solution:
You can use Route::currentRouteName()
Jump to solution
3 Replies
Jay
JayOP15mo ago
If not, can something tell me how to hide the relation using any other methods? I only want it to show in the infolist view page
Solution
Thijmen
Thijmen15mo ago
You can use Route::currentRouteName()
Jay
JayOP15mo ago
Thanks!
Want results from more Discord servers?
Add your server