Hide or override Dashboard

I am encountering an interesting issue. My clients requirement is to remove (for now) the default Dashboard, as shown in the first screenshot. I thought it should be pretty straightforward cause I saw the default dashboard registered in the pages method of the AdminPanelProvider. Removing it didn't work. Investigating a bit more I realized that I can also override the Dashboard class and adjust it to my liking so that's what I did. I also removed all the discover related methods and the widgets method in hopes something went wrong somehow. Guess what? It didn't work. I tried clearing the cache, clearing the browser cache, using a new browser to no results. I am 100% sure that I am missing something but I am out of options. This is my current code:
No description
No description
5 Replies
awcodes
awcodes3mo ago
just removing it from the ->pages() method works for me. Please share your actual code according to https://discord.com/channels/883083792112300104/1167015843020943390
No description
No description
No description
ptamayo
ptamayoOP3mo ago
Hi @awcodes thanks for the answer, that's what confuses me, it should work just like that. There's a character limit on the post form so I couldn'r share the whole code as text, let me try here
awcodes
awcodes3mo ago
you can put it in a Gist too and link to that
ptamayo
ptamayoOP3mo ago
Gist
AdminPanelProvider.php
AdminPanelProvider.php. GitHub Gist: instantly share code, notes, and snippets.
Gist
CustomDashboard.php
CustomDashboard.php. GitHub Gist: instantly share code, notes, and snippets.
awcodes
awcodes3mo ago
and if you remove CustomDashboard from the pages() method it's still showing up? If you still want the custom dashboard but not have it in the navigation you are going to have to do a custom navigation.
Want results from more Discord servers?
Add your server