I want to show / hide an option from menu depending some field from user table. Exist a way to do that ? For example if user.isFirst() then hide option 'Product' from menu.
easy_admin:
site_name: '<img src="/build/images/logo.png" alt="dfg" />'
formats:
datetime: 'Y-m-d'
design:
brand_color: '#009036'
color_scheme: 'light'
form_theme: 'vertical'
templates:
layout: 'admin/default/layout.html.twig' #for rewrite layout and add edit my account button
menu:
- label: 'menu.labels.dashboard'
route: 'route_declarant_dashboard'
icon: 'dashboard'
default: true
params:
menuIndex: 0
- label: 'menu.labels.products'
entity: 'Products'
icon: 'shopping-bag'
- label: 'menu.labels.users'
entity: 'Users'
icon: 'bullhorn'
So the idea is :
Hide "Products" --> if user.isFirst()
Show "Products" --> other cases.