runlinenl / nova-profile-tool

This package adds a tool for Laravel nova to let a user manage their profile data
MIT License
37 stars 40 forks source link

Option to hide it from sidebar #6

Closed bernhardh closed 5 years ago

bernhardh commented 6 years ago

I think the best place for a link to your own profil is in the dropdown of your username (in the right corner of nova). You can easily add this link by changing the code of views/vendor/nova/partials/user.blade.php.

But how can I hide the menu point from sidebar navigation? If I add the ProfileTool to the tools() method of NovaServiceProvider, it is automatically rendered in the sidebar.

mattsims commented 5 years ago

Like this:

/**
 * Get the tools that should be listed in the Nova sidebar.
 *
 * @return array
 */
public function tools()
{
    return [
        (new \Runline\ProfileTool\ProfileTool)->canSee(function ($request) {
            return false;
        }),
    ];
}

:+1:

patrickbergman commented 5 years ago

I believe the last comment makes it clear 👍

tolawho commented 5 years ago

Like this:

/**
 * Get the tools that should be listed in the Nova sidebar.
 *
 * @return array
 */
public function tools()
{
    return [
        (new \Runline\ProfileTool\ProfileTool)->canSee(function ($request) {
            return false;
        }),
    ];
}

👍

You will can't access the link.

bernhardh commented 4 years ago

Thats correct, thats no solution. As far as I know, there is no solution to hide a tool form sidebar, if the tool doesn't provide a function for it.