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(''.__('messages.category').'', ['class' => '']) ->prepend('') ->nickname('category') ->data('permission', 'category list') ->link->attr(["class" => ""]) ->href('#categories'); $menu->category->add(''.__('messages.list_form_title',['form' => trans('messages.category') ]).'', [ 'class' => 'sidebar-layout' , 'route' => ['category.index']]) ->prepend('') ->data('permission', 'category list') ->link->attr(array('class' => '')); $menu->category->add(''.__('messages.add_form_title',['form' => trans('messages.category')]).'', array( 'class' => 'sidebar-layout', 'route' => 'category.create')) ->prepend('') ->data('permission', 'category add') ->link->attr(['class' => '']); $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(''.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->service->add(''.trans('messages.list_form_title',['form' => trans('messages.rating')]).'', ['class' => 'sidebar-layout' ,'route' => 'ratingreview.index']) ->prepend('') ->data('permission', 'service list') ->link->attr(['class' => '']); $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.add_form_title',['form' => __('messages.provider')]).'', ['class' => 'sidebar-layout' ,'route' => 'provider.create']) ->data('permission', 'provider add') ->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.payout_history').'', ['class' => 'sidebar-layout' ,'route' => ['providerpayout.index']]) ->data('permission', 'provider payout') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.provider_address').'', ['class' => '']) ->prepend('') ->nickname('provideraddress') ->data('permission', 'provideraddress list') ->link->attr(["class" => ""]) ->href('#provideraddress'); $menu->provideraddress->add(''.__('messages.list_form_title',['form' => __('messages.provider_address')]).'', ['class' => 'sidebar-layout' ,'route' => 'provideraddress.index']) ->data('permission', 'provideraddress list') ->prepend('') ->link->attr(['class' => '']); $menu->provideraddress->add(''.__('messages.add_form_title',['form' => __('messages.provider_address')]).'', ['class' => 'sidebar-layout' ,'route' => 'provideraddress.create']) ->data('permission', 'provideraddress add') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.providertype').'', ['class' => '']) ->prepend('') ->nickname('providertype') ->data('permission', 'providertype list') ->link->attr(["class" => ""]) ->href('#providertypes'); $menu->providertype->add(''.__('messages.list_form_title',['form' => __('messages.providertype')]).'', ['class' => 'sidebar-layout' ,'route' => 'providertype.index']) ->data('permission', 'providertype list') ->prepend('') ->link->attr(['class' => '']); $menu->providertype->add(''.__('messages.add_form_title',['form' => __('messages.providertype')]).'', ['class' => 'sidebar-layout' ,'route' => 'providertype.create']) ->data('permission', 'providertype add') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.providerdocument').'', ['class' => '']) ->prepend('') ->nickname('providerdocument') ->data('permission', 'providerdocument list') ->link->attr(["class" => ""]) ->href('#providerdocument'); $menu->providerdocument->add(''.__('messages.list_form_title',['form' => __('messages.providerdocument')]).'', ['class' => 'sidebar-layout' ,'route' => 'providerdocument.index']) ->data('permission', 'providerdocument list') ->prepend('') ->link->attr(['class' => '']); $menu->providerdocument->add(''.__('messages.add_form_title',['form' => __('messages.providerdocument')]).'', ['class' => 'sidebar-layout' ,'route' => 'providerdocument.create']) ->data('permission', 'providerdocument add') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.bookings').'', ['route' => 'booking.index']) ->prepend('') ->nickname('booking') ->data('permission','booking list'); $menu->add(''.__('messages.tax').'', ['route' => 'tax.index']) ->prepend('') ->nickname('tax') ->data('role','admin'); $menu->add(''.__('messages.earning').'', ['route' => 'earning']) ->prepend('') ->nickname('earning') ->data('role','admin'); $menu->add(''.__('messages.handyman').'', ['class' => '']) ->prepend('') ->nickname('handyman') ->data('permission', 'handyman list') ->link->attr(["class" => ""]) ->href('#handymans'); $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.add_form_title',['form' => __('messages.handyman')]).'', ['class' => 'sidebar-layout' ,'route' => 'handyman.create']) ->data('permission', 'handyman add') ->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->add(''.__('messages.users').'', ['route' => 'user.index']) ->prepend('') ->nickname('user') ->data('permission', 'user list'); $menu->add(''.__('messages.coupon').'', ['class' => '']) ->prepend('') ->nickname('coupon') ->data('permission', 'coupon list') ->link->attr(["class" => ""]) ->href('#coupons'); $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(''.trans('messages.payment').'', ['class' => '']) ->prepend('') ->nickname('payment') ->data('permission', 'payment list') ->link->attr(["class" => ""]) ->href('#payment'); $menu->payment->add(''.trans('messages.list_form_title',['form' => trans('messages.payment')]).'', ['class' => 'sidebar-layout' ,'route' => 'payment.index']) ->data('permission', 'payment list') ->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.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.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.setting').'', ['route' => 'setting.index']) ->prepend('') ->nickname('setting') ->data('permission', 'system setting'); })->filter(function ($item) { return checkMenuRoleAndPermission($item); }); @endphp