use Lavary\Menu\Menu; @php $url = ''; $MyNavBar = \Menu::make('MenuList', function ($menu) use($url){ //Admin Dashboard $menu->add(''.__('messages.dashboard').'', ['route' => 'home']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.trans('messages.category').'', ['class' => '']) ->prepend('') ->nickname('category') ->data('permission', 'category list') ->link->attr(["class" => ""]) ->href('#category'); $menu->category->add(''.trans('messages.list_form_title',['form' => trans('messages.category')]).'', ['class' => 'sidebar-layout' ,'route' => 'category.index']) ->prepend('') ->data('permission', 'service list') ->link->attr(['class' => '']); $menu->category->add(''.trans('messages.add_form_title',['form' => trans('messages.category')]).'', ['class' => 'sidebar-layout' ,'route' => 'category.create']) ->data('permission', 'service add') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.trans('messages.subcategory').'', ['class' => '']) ->prepend('') ->nickname('subcategory') ->data('permission', 'subcategory list') ->link->attr(["class" => ""]) ->href('#subcategory'); $menu->subcategory->add(''.trans('messages.list_form_title',['form' => trans('messages.subcategory')]).'', ['class' => 'sidebar-layout' ,'route' => 'subcategory.index']) ->prepend('') ->data('permission', 'service list') ->link->attr(['class' => '']); $menu->subcategory->add(''.trans('messages.add_form_title',['form' => trans('messages.subcategory')]).'', ['class' => 'sidebar-layout' ,'route' => 'subcategory.create']) ->data('permission', 'service add') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.trans('messages.service').'', ['class' => '']) ->prepend('') ->nickname('service') ->data('permission', 'service list') ->link->attr(["class" => ""]) ->href('#services'); $menu->service->add(''.trans('messages.list_form_title',['form' => trans('messages.service')]).'', ['class' => 'sidebar-layout' ,'route' => 'service.index']) ->prepend('') ->data('permission', 'service list') ->link->attr(['class' => '']); $menu->service->add(''.trans('messages.add_form_title',['form' => trans('messages.service')]).'', ['class' => 'sidebar-layout' ,'route' => 'service.create']) ->data('permission', 'service add') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.plan').'', ['route' => 'plans.index']) ->prepend('') ->nickname('plan') ->data('permission', 'plan list'); $menu->add(''.__('messages.booking').'', ['route' => 'booking.index']) ->prepend('') ->nickname('booking') ->data('permission', 'booking list'); $menu->add(''.__('messages.provider').'', ['class' => '']) ->prepend('') ->nickname('provider') ->data('permission', 'provider list') ->link->attr(["class" => ""]) ->href('#providers'); $menu->provider->add(''.__('messages.list_form_title',['form' => __('messages.provider')]).'', ['class' => 'sidebar-layout' ,'route' => 'provider.index']) ->data('permission', 'provider list') ->prepend('') ->link->attr(['class' => '']); $menu->provider->add(''.__('messages.pending_list_form_title',['form' => __('messages.provider')]).'', ['class' => 'sidebar-layout' ,'route' => ['provider.pending','pending']]) ->data('permission', 'pending provider') ->prepend('') ->link->attr(['class' => '']); $menu->provider->add(''.__('messages.list_form_title',['form' => __('messages.providerdocument')]).'', ['class' => 'sidebar-layout' ,'route' => 'providerdocument.index']) ->data('permission', 'providerdocument list') ->prepend('') ->link->attr(['class' => '']); $menu->provider->add(''.__('messages.list_form_title',['form' => __('messages.provider_payout')]).'', ['class' => 'sidebar-layout' ,'route' => 'providerpayout.index']) ->data('permission', 'payout list') ->prepend('') ->link->attr(['class' => '']); $menu->provider->add(''.__('messages.list_form_title',['form' => __('messages.providertype')]).'', ['class' => 'sidebar-layout' ,'route' => 'providertype.index']) ->data('permission', 'providertype list') ->prepend('') ->link->attr(['class' => '']); $menu->provider->add(''.__('messages.list_form_title',['form' => __('messages.provider_address')]).'', ['class' => 'sidebar-layout' ,'route' => 'provideraddress.index']) ->data('permission', 'provideraddress list') ->prepend('') ->link->attr(['class' => '']); $menu->provider->add(''.__('messages.list_form_title',['form' => __('messages.wallet')]).'', ['class' => 'sidebar-layout' ,'route' => 'wallet.index']) ->data('permission', 'wallet list') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.handyman').'', ['class' => '']) ->prepend('') ->nickname('handyman') ->data('permission', 'handyman list') ->link->attr(["class" => ""]) ->href('#handyman'); $menu->handyman->add(''.__('messages.list_form_title',['form' => __('messages.handyman')]).'', ['class' => 'sidebar-layout' ,'route' => 'handyman.index']) ->data('permission', 'handyman list') ->prepend('') ->link->attr(['class' => '']); $menu->handyman->add(''.__('messages.pending_list_form_title',['form' => __('messages.handyman')]).'', ['class' => 'sidebar-layout' ,'route' => ['handyman.pending','pending']]) ->data('permission', 'pending handyman') ->prepend('') ->link->attr(['class' => '']); $menu->handyman->add(''.__('messages.pending_list_form_title',['form' => __('messages.handyman_earning')]).'', ['class' => 'sidebar-layout' ,'route' => 'handymanEarning']) ->data('permission', 'handyman earning') ->prepend('') ->link->attr(['class' => '']); $menu->handyman->add(''.__('messages.pending_list_form_title',['form' => __('messages.handymantype')]).'', ['class' => 'sidebar-layout' ,'route' => 'handymantype.index']) ->data('permission', 'handymantype list') ->prepend('') ->link->attr(['class' => '']); $menu->handyman->add(''.__('messages.pending_list_form_title',['form' => __('messages.handymanpayout')]).'', ['class' => 'sidebar-layout' ,'route' => 'handymanpayout.index']) ->data('permission', 'handymanpayout list') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.users').'', ['route' => 'user.index']) ->prepend('') ->nickname('user') ->data('permission', 'user list'); $menu->add(''.__('messages.payment').'', ['route' => 'payment.index']) ->prepend('') ->nickname('payment') ->data('permission', 'payment list'); $menu->add(''.__('messages.earning').'', ['route' => 'earning']) ->prepend('') ->nickname('earning') ->data('permission', 'earning list'); $menu->add(''.__('messages.document').'', ['class' => '']) ->prepend('') ->nickname('document') ->data('permission', 'document list') ->link->attr(["class" => ""]) ->href('#document'); $menu->document->add(''.__('messages.list_form_title',['form' => trans('messages.document') ]).'', [ 'class' => 'sidebar-layout' , 'route' => ['document.index']]) ->prepend('') ->data('permission', 'document list') ->link->attr(array('class' => '')); $menu->document->add(''.__('messages.add_form_title',['form' => trans('messages.document')]).'', array( 'class' => 'sidebar-layout', 'route' => 'document.create')) ->prepend('') ->data('permission', 'document add') ->link->attr(['class' => '']); $menu->add(''.__('messages.tax').'', ['route' => 'tax.index']) ->prepend('') ->nickname('tax') ->data('permission', 'tax list'); $menu->add(''.__('messages.coupon').'', ['class' => '']) ->prepend('') ->nickname('coupon') ->data('permission', 'coupon list') ->link->attr(["class" => ""]) ->href('#coupon'); $menu->coupon->add(''.__('messages.list_form_title',['form' => __('messages.coupon')]).'', ['class' => 'sidebar-layout' ,'route' => 'coupon.index']) ->data('permission', 'coupon list') ->prepend('') ->link->attr(['class' => '']); $menu->coupon->add(''.__('messages.add_form_title',['form' => __('messages.coupon')]).'', ['class' => 'sidebar-layout' ,'route' => 'coupon.create']) ->data('permission', 'coupon add') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.slider').'', ['class' => '']) ->prepend('') ->nickname('sliders') ->data('permission', 'slider list') ->link->attr(["class" => ""]) ->href('#sliders'); $menu->sliders->add(''.__('messages.list_form_title',['form' => __('messages.slider')]).'', ['class' => 'sidebar-layout' ,'route' => 'slider.index']) ->data('permission', 'slider list') ->prepend('') ->link->attr(['class' => '']); $menu->sliders->add(''.__('messages.add_form_title',['form' => __('messages.slider')]).'', ['class' => 'sidebar-layout' ,'route' => 'slider.create']) ->data('permission', 'slider add') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.pages').'', ['class' => '']) ->prepend('') ->nickname('pages') ->data('permission', 'pages') ->link->attr(["class" => ""]) ->href('#pages'); $menu->pages->add(''.__('messages.terms_condition').'', ['class' => 'sidebar-layout' ,'route' => 'term-condition']) ->data('permission', 'terms condition') ->prepend('') ->link->attr(['class' => '']); $menu->pages->add(''.__('messages.privacy_policy').'', ['class' => 'sidebar-layout' ,'route' => 'privacy-policy']) ->data('permission', 'privacy policy') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.account_setting').'', ['class' => '']) ->prepend('') ->nickname('account_setting') ->data('permission', ['role list','permission list']) ->link->attr(["class" => ""]) ->href('#account_setting'); $menu->account_setting->add(''.__('messages.list_form_title',['form' => __('messages.role')]).'', ['class' => 'sidebar-layout' ,'route' => 'role.index']) ->data('permission', 'role list') ->prepend('') ->link->attr(['class' => '']); $menu->account_setting->add(''.__('messages.list_form_title',['form' => __('messages.permission')]).'', ['class' => 'sidebar-layout' ,'route' => 'permission.index']) ->data('permission', 'permission list') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.setting').'', ['route' => 'setting.index']) ->prepend('') ->nickname('setting') ->data('permission', 'system setting'); })->filter(function ($item) { return checkMenuRoleAndPermission($item); }); @endphp