Open brunocoelhosilva opened 11 months ago
I am facing the same issue
Whats laravel & nova version do you use?
I'm using the most recent versions of each package:
Nova: 4.32.6 Laravel: 10.34.2
Nova:4.32.6 Laravel: 10.35.0
Here is a fix:
namespace App\Nova;
class Activitylog extends \Bolechen\NovaActivitylog\Resources\Activitylog { public static $displayInNavigation = false;
}
2. Swap the model in the `nova-activitylog.php` config (publish it if you havent)
``` 'resource' => \App\Nova\ActivityLog::class,```
Now it will remove the link in the Resources section and only leave the link with the icon.
It worked for me.
Here is a fix:
- Create a new ActivityLog Resource and extend the original, and just disable the resources link
namespace App\Nova; class Activitylog extends \Bolechen\NovaActivitylog\Resources\Activitylog { public static $displayInNavigation = false; }
- Swap the model in the
nova-activitylog.php
config (publish it if you havent)'resource' => \App\Nova\ActivityLog::class,
Now it will remove the link in the Resources section and only leave the link with the icon.It worked for me.
I'm sorry for the inconvenience.For my own personal reasont, ican't have nova 4.x access, but thx for you help.
I see the $displayInNavigation
changed default to true
by this PR #27 by @Kussie
I want ask to Kussis, may I ask for your reasoning as to why you did what you did at the time?Does it need to be changed back?
Here is a fix:
- Create a new ActivityLog Resource and extend the original, and just disable the resources link
namespace App\Nova; class Activitylog extends \Bolechen\NovaActivitylog\Resources\Activitylog { public static $displayInNavigation = false; }
- Swap the model in the
nova-activitylog.php
config (publish it if you havent)'resource' => \App\Nova\ActivityLog::class,
Now it will remove the link in the Resources section and only leave the link with the icon.It worked for me.
I'm sorry for the inconvenience.For my own personal reasont, ican't have nova 4.x access, but thx for you help. I see the
$displayInNavigation
changed default totrue
by this PR #27 by @Kussie I want ask to Kussis, may I ask for your reasoning as to why you did what you did at the time?Does it need to be changed back?
Without that change at the time it wouldn't appear at all if i recall. Given this hasnt been an issue until recently i wonder if there has been a change in Nova that has altered the behaviour. I no longer use Nova so i'm not sure
thx @Kussie response. i change the flag default to false. Please try the latest version to see if it's working. Thanks to all for your help.
@bolechen Thanks for your help.
However, when you set public static $displayInNavigation = false;
both items in the menu disappear. My solution for now is to put public static $displayInNavigation = true;
and remove new NovaActivitylog()
from the tools
method in NovaServiceProvider.php
It looks like Nova 4 has refactored the Tools menu, since I personally don't have access to it, I'm hoping some kind soul can submit a PR, here's a link to the official instructions I found on it:
Customized Main Menu
If you have [customized Nova's main sidebar menu](https://nova.laravel.com/docs/menus.html#customizing-the-main-menu), a link to your tool will not automatically display in Nova's sidebar. You will need to manually define your tool's menu inside your custom Nova::mainMenu callback.
@ref https://nova.laravel.com/docs/customization/tools.html#navigation
Hide navigation link only in Resources and not everywhere: https://github.com/laravel/nova-issues/discussions/4368
Hi there,
In the documentation it only shows "Activity Logs" in the menu once, but in my case it also appears within Resources. Is this expected? I would like only the bottom one to appear. Thanks.