Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide from navigation #33

Closed
PrzemekTkaczyk opened this issue Jun 29, 2020 · 7 comments
Closed

Hide from navigation #33

PrzemekTkaczyk opened this issue Jun 29, 2020 · 7 comments

Comments

@PrzemekTkaczyk
Copy link

Hello,
First, thank you for creating this package!
Is there any simple option to hide it from navigation (not using roles/permissions) ?

@bakerkretzmar
Copy link
Owner

Who do you want to hide it from? You can probably do this the same way you would with auth:

public function tools()
{
    return [
        (new SettingsTool)->canSee(function ($request) {
            return false;
        }),
    ];
}

You can put whatever you want in that closure though, so you could limit it to a specific email or user group or whatever. Let me know if that works!

Docs

@PrzemekTkaczyk
Copy link
Author

Yes, I know this, and there I use speciffic role or permission - for autohorization users,
but I don't want to see it in navigation - because I have custom file for navigation - and now your tool automatically appear on bottom of menu :)
(on all tools I have removed code from "naviagation.blade"

If there is no option - I will create a fork..

@bakerkretzmar
Copy link
Owner

bakerkretzmar commented Jun 30, 2020

Interesting, how are you rendering a custom navigation? Wouldn't that override everything, including this tool?

@PrzemekTkaczyk
Copy link
Author

No, it just override nova-view which render navigation:
I just made a file: PROJECT/resources/views/vendor/nova/resources/navigation.blade.php, but all other scripts are working normally, that's why "SETTINGS" are appear on the bottom of menu :)

@bakerkretzmar
Copy link
Owner

Do you have any other tools installed? Do they show up?

@bakerkretzmar
Copy link
Owner

@PrzemekTkaczyk thanks for your patience.

Create a file in your project at resources/views/vendor/settings-tool/navigation.blade.php. This will override the sidebar item completely, so to hide it, just leave that file empty.

@PrzemekTkaczyk
Copy link
Author

Thanks a lot ! :). 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants