{"id":249,"date":"2023-01-20T18:37:42","date_gmt":"2023-01-20T15:37:42","guid":{"rendered":"https:\/\/akaunting.com\/hc\/?post_type=docs&#038;p=249"},"modified":"2023-01-21T16:13:21","modified_gmt":"2023-01-21T13:13:21","slug":"menu","status":"publish","type":"docs","link":"https:\/\/akaunting.com\/hc\/docs\/developers\/menu\/","title":{"rendered":"Menu"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The left sidebar of Akaunting contains the company switcher and menu. We use the&nbsp;<a href=\"https:\/\/github.com\/akaunting\/laravel-menu\" target=\"_blank\" rel=\"noreferrer noopener\">akaunting\/laravel-menu<\/a>&nbsp;package as builder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may want to extend the menu by adding your own pages. You should listen to the&nbsp;<code>AdminCreated<\/code>&nbsp;event for admin and\/or&nbsp;<code>PortalCreated<\/code>&nbsp;for client sides.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a listener example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\nnamespace Modules\\MyBlog\\Listeners;\n\nuse App\\Events\\Menu\\AdminCreated as Event;\n\nclass AddToAdminMenu\n{\n    public function handle(Event $event): void\n    {\n        \/\/ Add child to existing menu item\n        $item = $event->menu->whereTitle(trans_choice('general.sales', 2));\n        $item->route('my-blog.posts.index', trans('my-blog::general.posts'), [], 4, ['icon' => '']);\n\n        \/\/ Add new menu item\n        $event->menu->add([\n            'route' => ['my-blog.posts.index', []],\n            'title' => trans('my-blog::general.posts'),\n            'icon' => 'edit',\n            'order' => 15,\n        ]);\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/akaunting\/laravel-menu\/wiki\" target=\"_blank\">Menu&nbsp;<\/a>documentation can help to understand the system, especially about how to find a menu item, add child ones, and create dropdown menus.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Icons<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Akaunting ships with the following icon packs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Google icons&nbsp;<a href=\"https:\/\/fonts.google.com\/icons?icon.set=Material+Icons\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/fonts.google.com\/icons<\/a><\/li>\n\n\n\n<li>Brand icons&nbsp;<a href=\"https:\/\/simpleicons.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/simpleicons.org<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re going to use any brand icon, you should add&nbsp;<code>simple-icons-<\/code>&nbsp;prefix to the icon name. Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">simple-icons-paypal<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The left sidebar of Akaunting contains the company switcher and menu. We use the&nbsp;akaunting\/laravel-menu&nbsp;package as builder. You may want to extend the menu by adding your own pages. You should listen to the&nbsp;AdminCreated&nbsp;event for admin and\/or&nbsp;PortalCreated&nbsp;for client sides. Here is a listener example: Menu&nbsp;documentation can help to understand the system, especially about how to find [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":31,"menu_order":4,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-249","docs","type-docs","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/docs\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/comments?post=249"}],"version-history":[{"count":11,"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/docs\/249\/revisions"}],"predecessor-version":[{"id":268,"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/docs\/249\/revisions\/268"}],"up":[{"embeddable":true,"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/docs\/31"}],"wp:attachment":[{"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/media?parent=249"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/akaunting.com\/hc\/wp-json\/wp\/v2\/doc_tag?post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}