@php $url = ''; $MyNavBar = \Menu::make('MenuList', function ($menu) use($url){ $menu->add(''.__('messages.main').'', ['class' => 'category-main']); $menu->add(''.__('messages.dashboard').''.__('messages.dashboard').'', ['route' => 'home']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.bookings').''.__('messages.bookings').'', ['route' => 'booking.index']) ->prepend('') ->nickname('booking') ->data('permission', 'booking list'); $menu->add(__('messages.sidebar_form_title',['form' => trans('messages.service')]), ['class' => 'category-main']) ->data('permission', ['category list','subcategory list','service list']); $menu->add(''.__('messages.category').''.__('messages.category').'', ['route' => 'category.index', ]) ->prepend('') ->data('permission', 'category list') ->link->attr(['class' => '']); $menu->add(''.__('messages.subcategory').''.__('messages.subcategory').'', ['route' => 'subcategory.index']) ->prepend('') ->data('permission', 'subcategory list') ->link->attr(['class' => '']); $menu->add(''.trans('messages.services').''.__('messages.services').'', ['class' => '']) ->prepend('') ->nickname('services') ->data('permission', 'service list') ->link->attr(["class" => ""]) ->href('#services'); $menu->services->add(''.trans('messages.all_form_title',['form' => trans('messages.services')]).'', ['class' => 'sidebar-layout' ,'route' => 'service.index']) ->prepend('') ->data('permission', 'service list') ->link->attr(['class' => '']); $settings = App\Models\Setting::whereIn('type', ['service-configurations','OTHER_SETTING']) ->whereIn('key', ['service-configurations', 'OTHER_SETTING']) ->get() ->keyBy('type'); $servicesetting = $settings->has('service-configurations') ? json_decode($settings['service-configurations']->value) : null; $othersetting = $settings->has('OTHER_SETTING') ? json_decode($settings['OTHER_SETTING']->value) : null; if(optional($servicesetting)->service_packages == 1){ $menu->services->add(''.trans('messages.packages').'', ['class' => 'sidebar-layout' ,'route' => 'servicepackage.index']) ->prepend(' ') ->data('permission', 'servicepackage list' ) ->link->attr(['class' => '']); } if(optional($servicesetting)->service_addons == 1){ $menu->services->add(''.trans('messages.addons').'', ['class' => 'sidebar-layout' ,'route' => 'serviceaddon.index']) ->prepend(' ') ->data('permission', ['service add on list']) ->link->attr(['class' => '']); } if(optional($servicesetting)->post_services == 1){ $menu->add(__('messages.sidebar_form_title',['form' => trans('messages.custom_job')]), ['class' => 'category-main'])->data('permission', 'postjob'); $menu->add(''.__('messages.job_request_list').''.__('messages.job_request_list').'', ['route' => 'post-job-request.index']) ->prepend('') ->nickname('post_job') ->data('permission', 'postjob'); $menu->add(''.__('messages.job_service_list').''.__('messages.subcategory').'', ['route' => 'service.user-service-list']) ->prepend('') ->data('permission', 'userservice list') ->link->attr(['class' => '']); } $menu->add(__('messages.sidebar_form_title',['form' => trans('messages.user')]), ['class' => 'category-main'])->data('permission', ['provider list','handyman list','user list']); if(auth()->user()->user_type == 'admin' || auth()->user()->user_type == 'demo_admin'){ $menu->add(''.__('messages.providers').''.__('messages.providers').'', ['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.list_form_title',['form' => __('messages.providerrequest')]).'', ['class' => 'sidebar-layout' ,'route' => ['provider.pending','pending']]) ->data('permission', 'pending provider') ->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' => '']); if(default_earning_type() === 'subscription'){ $menu->provider->add(''.__('messages.list_form_title',['form' => __('messages.subscribe')]).'', ['class' => 'sidebar-layout' ,'route' => ['provider.pending','subscribe']]) ->data('role', 'admin') ->prepend('') ->link->attr(['class' => '']); } } $menu->add(''.__('messages.handymen').''.__('messages.handymen').'', ['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.list_form_title',['form' => __('messages.handymanrequest')]).'', ['class' => 'sidebar-layout' ,'route' => ['handyman.pending','request']]) ->data('permission', 'pending handyman') ->prepend('') ->link->attr(['class' => '']); $menu->handyman->add(''.__('messages.unassigned_list_form_title',['form' => __('messages.handyman')]).'', ['class' => 'sidebar-layout' ,'route' => ['handyman.pending','unassigned']]) ->data('permission', 'pending handyman') ->prepend('') ->link->attr(['class' => '']); $menu->handyman->add(''.__('messages.list_form_title',['form' => __('messages.handyman_earning')]).'', ['class' => 'sidebar-layout' ,'route' => 'handymanEarning']) ->data('role', 'provider') ->prepend('') ->link->attr(['class' => '']); $menu->handyman->add(''.__('messages.list_form_title',['form' => __('messages.handymantype')]).'', ['class' => 'sidebar-layout' ,'route' => 'handymantype.index']) ->data('permission', 'handymantype list') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.unverified').''.__('messages.unverified').'', ['route' => ['user.all','unverified']]) ->prepend(' ') ->nickname('user') ->data('permission', 'user list'); $menu->add(''.__('messages.customers').''.__('messages.customers').'', ['route' => 'user.index']) ->prepend('') ->nickname('user') ->data('permission', 'user list'); $menu->add(''.__('messages.all_user').''.__('messages.users').'', ['route' => ['user.all','all']]) ->prepend(' ') ->nickname('user') ->data('permission', 'user list'); $menu->add('Transactions', ['class' => 'category-main'])->data('permission', ['tax list','payment list','earning list']); $menu->add(''.__('messages.payments').''.__('messages.payments').'', ['route' => 'payment.index']) ->prepend(' ') ->nickname('payment') ->data('permission', 'payment list'); $menu->add(''.__('messages.cash_payments').''.__('messages.cash_payments').'', ['route' => 'cash.list']) ->prepend(' ') ->nickname('cash_history') ->data('permission', 'payment list'); $menu->add(''.__('messages.earnings').''.__('messages.earnings').'', ['route' => 'earning']) ->prepend(' ') ->nickname('earning') ->data('permission', 'earning list'); if(auth()->user()->user_type == 'provider' || auth()->user()->user_type == 'admin' || auth()->user()->user_type == 'demo_admin'){ $menu->add(''.__('messages.provider_withdrawal_requests').''.__('messages.provider_withdrawal_requests').'', ['route' => 'wallet_transaction']) ->prepend(' ') ->nickname('provider_withdrawal_requests') ->data('permission', 'service list'); } $menu->add(__('messages.promotion'), ['class' => 'category-main'])->data('permission', 'coupon list'); $menu->add(''.__('messages.coupons').''.__('messages.coupons').'', ['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.app_sliders').''.__('messages.app_sliders').'', ['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('Ratings', ['class' => 'category-main'])->data('permission', ['userrating list','handymanrating list']); $menu->add(''.trans('messages.list_form_title',['form' => trans('messages.user_ratings')]).''.__('messages.user_ratings').'', ['route' => 'booking-rating.index']) ->prepend('') ->nickname('user_ratings') ->data('permission', 'userrating list'); $menu->add(''.trans('messages.list_form_title',['form' => trans('messages.handyman_ratings')]).''.__('messages.handyman_ratings').'', ['route' => 'handyman-rating.index']) ->prepend('') ->nickname('handyman_ratings') ->data('permission', 'handymanrating list'); $menu->add(__('messages.sidebar_form_title',['form' => trans('messages.system')]), ['class' => 'category-main']) ->data('permission', ['terms condition','privacy policy','help support','refund cancellation policy','document list']); if(default_earning_type() === 'subscription'){ $menu->add(''.__('messages.plan').''.__('messages.plan').'', ['route' => 'plans.index']) ->prepend(' ') ->nickname('plan') ->data('permission', 'plan list'); } $menu->add(''.__('messages.taxes').''.__('messages.taxes').'', ['route' => 'tax.index']) ->prepend('') ->nickname('tax') ->data('permission', 'tax list'); if(optional($othersetting)->blog == 1){ $menu->add(''.__('messages.blogs').''.__('messages.blogs').'', ['route' => 'blog.index']) ->data('role', ['admin','demo_admin']) ->prepend(' ') ->link->attr(['class' => '']); } $menu->add(''.__('messages.pushnotification_settings').''.__('messages.pushnotification_settings').'', ['route' => 'pushNotification.index']) ->data('role', ['admin','demo_admin']) ->prepend(' ') ->link->attr(['class' => '']); $menu->add(''.__('messages.notification_templates').''.__('messages.notification_templates').'', ['route' => 'notification-templates.index']) ->prepend('') ->nickname('notification_template') ->data('role', ['admin','demo_admin']) ->link->attr(["class" => ""]); $menu->add(''.__('messages.pages').''.__('messages.pages').'', ['class' => '']) ->prepend(' ') ->nickname('pages') ->data('role', 'admin') ->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->pages->add(''.__('messages.help_support').'', ['class' => 'sidebar-layout' ,'route' => 'help-support']) ->data('permission', 'Help and support') ->prepend('') ->link->attr(['class' => '']); $menu->pages->add(''.__('messages.refund_cancellation_policy').'', ['class' => 'sidebar-layout' ,'route' => 'refund-cancellation-policy']) ->data('permission', 'Refund and Cancellation Policy') ->prepend('') ->link->attr(['class' => '']); $menu->pages->add(''.__('messages.data_deletion_request').'', ['class' => 'sidebar-layout' ,'route' => 'data-deletion-request']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('messages.documents').''.__('messages.documents').'', ['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.frontend_setting').''.__('messages.frontend_setting').'', ['route' => 'frontend_setting.index']) ->prepend('') ->nickname('frontend_setting') ->data('role', ['admin','demo_admin']) ->link->attr(["class" => ""]); $menu->add(''.__('messages.Settings').''.__('messages.Settings').'', ['route' => 'setting.index']) ->prepend(' ') ->nickname('setting') ->data('role', ['admin','demo_admin']); })->filter(function ($item) { return checkMenuRoleAndPermission($item); }); @endphp