@php $url = ''; $MyNavBar = \Menu::make('MenuList', function ($menu) use($url){ $menu->add(''. __('message.new_booking') .'', ['route' => 'dispatch.create']) ->prepend('') ->data('permission', 'dispatch add'); //Admin Dashboard $menu->add(''.__('message.dashboard').'', ['route' => 'home']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.rider').'', ['class' => '']) ->prepend('') ->nickname('rider') ->data('permission', 'rider list') ->link->attr(['class' => '']) ->href('#rider'); $menu->rider->add(''.__('message.list_form_title',['form' => __('message.rider')]).'', ['class' => 'sidebar-layout' ,'route' => 'rider.index']) ->data('permission', 'rider list') ->prepend('') ->link->attr(['class' => '']); $menu->rider->add(''.__('message.add_form_title',['form' => __('message.rider')]).'', ['class' => 'sidebar-layout' ,'route' => 'rider.create']) ->data('permission', [ 'rider add', 'rider edit']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.region').'', ['class' => '']) ->prepend('') ->nickname('region') ->data('permission', 'region list') ->link->attr(['class' => '']) ->href('#region'); $menu->region->add(''.__('message.list_form_title',['form' => __('message.region')]).'', ['class' => 'sidebar-layout' ,'route' => 'region.index']) ->data('permission', 'region list') ->prepend('') ->link->attr(['class' => '']); $menu->region->add(''.__('message.add_form_title',['form' => __('message.region')]).'', ['class' => 'sidebar-layout' ,'route' => 'region.create']) ->data('permission', [ 'region add', 'region edit']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.service').'', [ 'class' => '', 'route' => 'service.index']) ->prepend('') ->nickname('service') ->data('permission', 'service list') ->link->attr(['class' => '']) ->href('#service'); $menu->service->add(''.__('message.list_form_title',['form' => __('message.service')]).'', ['class' => 'sidebar-layout' ,'route' => 'service.index']) ->data('permission', 'service list') ->prepend('') ->link->attr(['class' => '']); $menu->service->add(''.__('message.add_form_title',['form' => __('message.service')]).'', ['class' => request()->is('service/*/edit') ? 'sidebar-layout active' : 'sidebar-layout','route' => 'service.create']) ->data('permission', [ 'service add', 'service edit']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.driver').'', ['class' => '']) ->prepend('') ->nickname('driver') ->data('permission', 'driver list') ->link->attr(['class' => '']) ->href('#driver'); $menu->driver->add(''.__('message.list_form_title',['form' => __('message.driver')]).'', ['class' => 'sidebar-layout' ,'route' => 'driver.index']) ->data('permission', 'driver list') ->prepend('') ->link->attr(['class' => '']); $menu->driver->add(''.__('message.pending_list_form_title',['form' => __('message.driver')]).'', ['class' => 'sidebar-layout' ,'route' => ['driver.pending', 'pending'] ]) ->data('permission', 'driver list') ->prepend('') ->link->attr(['class' => '']); $menu->driver->add(''.__('message.add_form_title',['form' => __('message.driver')]).'', ['class' => request()->is('driver/*/edit') ? 'sidebar-layout active' : 'sidebar-layout', 'route' => 'driver.create']) ->data('permission', [ 'driver add', 'driver edit']) ->prepend('') ->link->attr(['class' => '']); $menu->driver->add(''.__('message.manage_driver_document').'', ['class' => ( request()->is('driverdocument') || request()->is('driverdocument/*') ) ? 'sidebar-layout active' : 'sidebar-layout', 'route' => 'driverdocument.index']) ->data('permission', ['driverdocument list']) ->prepend('') ->link->attr(['class' => '']); $menu->driver->add(''.__('message.driver_earning').'', ['class' => ( request()->is('driver-earning') || request()->is('driver-earning/*') ) ? 'sidebar-layout active' : 'sidebar-layout', 'route' => 'driver.earning.list']) ->data('permission', ['driverearning list']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.document').'', ['class' => '']) ->prepend('') ->nickname('document') ->data('permission', 'document list') ->link->attr(['class' => '']) ->href('#document'); $menu->document->add(''.__('message.list_form_title',['form' => __('message.document')]).'', ['class' => 'sidebar-layout' ,'route' => 'document.index']) ->data('permission', 'document list') ->prepend('') ->link->attr(['class' => '']); $menu->document->add(''.__('message.add_form_title',['form' => __('message.document')]).'', ['class' => request()->is('document/*/edit') ? 'sidebar-layout active' : 'sidebar-layout', 'route' => 'document.create']) ->data('permission', [ 'document add', 'document edit']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.coupon').'', [ 'class' => '']) ->prepend('') ->nickname('coupon') ->data('permission', 'coupon list') ->link->attr(['class' => '']) ->href('#coupon'); $menu->coupon->add(''.__('message.list_form_title',['form' => __('message.coupon')]).'', ['class' => 'sidebar-layout' ,'route' => 'coupon.index']) ->data('permission', 'coupon list') ->prepend('') ->link->attr(['class' => '']); $menu->coupon->add(''.__('message.add_form_title',['form' => __('message.coupon')]).'', ['class' => request()->is('coupon/*/edit') ? 'sidebar-layout active' : 'sidebar-layout', 'route' => 'coupon.create']) ->data('permission', [ 'coupon add', 'coupon edit']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.riderequest').'', [ 'class' => '' ]) ->prepend('') ->nickname('riderequest') ->data('permission', 'riderequest list') ->link->attr(['class' => '']) ->href('#riderequest'); $menu->riderequest->add(''.__('message.list_form_title',['form' => __('message.riderequest')]).'', ['class' => 'sidebar-layout' ,'route' => 'riderequest.index']) ->data('permission', 'riderequest list') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.complaint').'', [ 'class' => '', 'route' => 'complaint.index']) ->prepend('') ->data('permission', 'complaint list') ->link->attr(['class' => '']); $menu->add(''.__('message.withdrawrequest').'', [ 'class' => '', 'route' => 'withdrawrequest.index']) ->prepend('') ->data('permission', 'withdrawrequest list') ->link->attr(['class' => '']); $menu->add(''.__('message.account_setting').'', ['class' => '']) ->prepend('') ->nickname('account_setting') ->data('permission', ['role list','permission list']) ->link->attr(["class" => ""]) ->href('#account_setting'); $menu->account_setting->add(''.__('message.list_form_title',['form' => __('message.role')]).'', ['class' => 'sidebar-layout' ,'route' => 'role.index']) ->data('permission', 'role list') ->prepend('') ->link->attr(['class' => '']); $menu->account_setting->add(''.__('message.list_form_title',['form' => __('message.permission')]).'', ['class' => 'sidebar-layout' ,'route' => 'permission.index']) ->data('permission', 'permission list') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.additionalfees').'', [ 'class' => '']) ->prepend('') ->nickname('additionalfees') ->data('permission', 'additionalfees list') ->link->attr(['class' => '']) ->href('#additionalfees'); $menu->additionalfees->add(''.__('message.list_form_title',['form' => __('message.additionalfees')]).'', ['class' => 'sidebar-layout' ,'route' => 'additionalfees.index']) ->data('permission', 'additionalfees list') ->prepend('') ->link->attr(['class' => '']); $menu->additionalfees->add(''.__('message.add_form_title',['form' => __('message.additionalfees')]).'', ['class' => request()->is('additionalfees/*/edit') ? 'sidebar-layout active' : 'sidebar-layout','route' => 'additionalfees.create']) ->data('permission', [ 'additionalfees add', 'additionalfees edit']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.sos').'', [ 'class' => '']) ->prepend('') ->nickname('sos') ->data('permission', 'sos list') ->link->attr(['class' => '']) ->href('#sos'); $menu->sos->add(''.__('message.list_form_title',['form' => __('message.sos')]).'', ['class' => 'sidebar-layout' ,'route' => 'sos.index']) ->data('permission', 'sos list') ->prepend('') ->link->attr(['class' => '']); $menu->sos->add(''.__('message.add_form_title',['form' => __('message.sos')]).'', ['class' => request()->is('sos/*/edit') ? 'sidebar-layout active' : 'sidebar-layout','route' => 'sos.create']) ->data('permission', [ 'sos add', 'sos edit']) ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.pages').'', ['class' => '']) ->prepend('') ->nickname('pages') ->data('permission', 'pages') ->link->attr(['class' => '']) ->href('#pages'); $menu->pages->add(''.__('message.terms_condition').'', ['class' => 'sidebar-layout' ,'route' => 'term-condition']) ->data('permission', 'terms condition') ->prepend('') ->link->attr(['class' => '']); $menu->pages->add(''.__('message.privacy_policy').'', ['class' => 'sidebar-layout' ,'route' => 'privacy-policy']) ->data('permission', 'privacy policy') ->prepend('') ->link->attr(['class' => '']); $menu->add(''.__('message.driver_location').'', ['route' => 'map']) ->prepend('') ->nickname('map') ->data('permission', 'driver location'); $menu->add(''.__('message.setting').'', ['route' => 'setting.index']) ->prepend('') ->nickname('setting') ->data('permission', 'system setting'); })->filter(function ($item) { return checkMenuRoleAndPermission($item); }); @endphp