Forum

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

New Discussion

Add section to Settings menu

Leonardo Gomes   ( User )

Commented 3 years ago

Hi Denis and community,

I am developping a custom module that needs to add some settings into it.

We follow the recommendation on the docs and create the Listener.


namespace Modules\TratoErp\Listeners;

use App\Events\Module\SettingShowing as Event;

class ShowInSettingsPage
{
/**
* Handle the event.
*
* @param Event $event
*
* @return void
*/
public function handle(Event $event)
{
#dump($event);
$event->modules->settings['trato-erp'] = [
'name' => trans('trato-erp::general.name'),
'description' => trans('trato-erp::general.description'),
'url' => route('trato-erp.settings.home'),
'icon' => 'fas fa-code',
];
#dd($event);
}
}

I dd just after the $event and i can see the details of the module. Yet, no item shows up.
I test the route and everything is fine with it.

Don't know how to proceed or how to debug. Can you help?

PS: for testing purpose, i try to add a menu on the left-sidebar as the procedure is pretty similar and it was successfull.


Thanks,

Denis Dulici   ( Admin )

Commented 3 years ago

Hello,

Make sure you've created a "read-trato-erp-settings" permission and assigned it to your role.

Regards

Please login or register to leave a response.

Showing 1 to 2 of 2 discussions