Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Double Menu Items were made

Donovan De Wet   ( User )

Commented 3 years ago

When adding the Menu/Listener to the the Provider. In the Right area it creates the Menu item but twice. Why is this and can someone explain to me why it is that when im trying to go to where that link on the menu is. It will reset or redirct back to the dashboard.

The Menu.php in the Module in the Listeners area

namespace Modules\Test\Listeners;

use App\Events\Menu\AdminCreated as Event;

class Menu
{
/**
* Handle the event.
*
* @param Event $event
* @return void
*/
public function handle(Event $event)
{
$event->menu->add([
'url' => '/test/test',
'title' => 'Main Test',
'icon' => 'fas fa-pen',
'order' => 6,
]);
}
}

the Event.php in the Providers area in the main app

protected $listen = [
...
'App\Events\Menu\AdminCreated' => [
'App\Listeners\Menu\AddAdminItems',
'Modules\Test\Listeners\Menu',
],
...

Once i add this it will make the Menu Item but two of them

Denis Dulici   ( Admin )

Commented 3 years ago

You should not change the core files, in your example the Event provider. Here you can learn more about adding a menu item of your module:

https://akaunting.com/docs/developer-manual/menu

Please login or register to leave a response.

Showing 1 to 2 of 2 discussions