<?php
    $url = '';
    use App\Models\WithdrawRequest;
    use App\Models\Order;
    use App\Models\User;
    use App\Models\Setting;
    use Carbon\Carbon;
    $MyNavBar = \Menu::make('MenuList', function ($menu) use($url){
        //Admin Dashboard


        if (Auth::user() && Auth::user()->user_type == 'admin' ) {
            $menu->add('<span>'.__('message.view_site').'</span>', ['route' => 'frontend-section'])
                ->prepend('<i class="fa fa-arrow-left"></i>')
                ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.dispatch').'</span>', [ 'class' => '', 'route' => 'order.create'])
                ->prepend('<i class="fa fa-plus"></i>')
                ->data('permission', 'add-order')
                ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.dashboard').'</span>', ['route' => 'home'])
                ->prepend('<i class="fas fa-home"></i>')
                ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.country').'</span>', ['class' => ''])
                ->prepend('<i class="fa-sharp fa fa-globe"></i>')
                ->nickname('country')
                ->data('permission', 'country list')
                ->link->attr(['class' => ''])
                ->href('#country');

            $menu->country->add('<span>'.__('message.add_form_title',['form' => __('message.country')]).'</span>', ['class' => request()->is('country/*/edit') ? 'sidebar-layout active' : 'sidebar-layout' ,'route' => 'country.create'])
                ->data('permission', [ 'add-country', 'country-edit'])
                ->prepend('<i class="fas fa-plus-square"></i>')
                ->link->attr(['class' => '']);

            $menu->country->add('<span>'.__('message.list_form_title',['form' => __('message.country')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'country.index'])
                ->data('permission', 'country list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.city').'</span>', ['class' => ''])
                ->prepend('<i class="fa fa-city"></i>')
                ->nickname('city')
                ->data('permission', 'city list')
                ->link->attr(['class' => ''])
                ->href('#city');

            $menu->city->add('<span>'.__('message.add_form_title',['form' => __('message.city')]).'</span>', ['class' => request()->is('country/*/edit') ? 'sidebar-layout active' : 'sidebar-layout' ,'route' => 'city.create'])
                ->data('permission', [ 'add-city', 'city-edit'])
                ->prepend('<i class="fas fa-plus-square"></i>')
                ->link->attr(['class' => '']);

            $menu->city->add('<span>'.__('message.list_form_title',['form' => __('message.city')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'city.index'])
                ->data('permission', 'city list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            $requestCount = Order::where('status', 'create')->count();
            $tomorrow = Carbon::tomorrow();
            $scheduleCount = Order::where(function ($query) use ($tomorrow) {
                $query->whereDate('pickup_datetime', $tomorrow)
                    ->orWhereDate('delivery_datetime', $tomorrow);
            })->count();
            $schedule = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash">' . $scheduleCount . '</span>';
            if($requestCount == 0){
            $menu->add('<span>'.__('message.order').'</span>', ['class' => ''])
                    ->prepend('<i class="fa fa-thin fa-file"></i>')
                    ->nickname('order')
                    ->data('permission', 'order-list')
                    ->link->attr(['class' => ''])
                    ->href('#order');
            }else{
            $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash" id="requestCount">' . $requestCount . '</span>';
            $menu->add('<span>'.__('message.order').' ' . $count . '</span>', ['class' => ''])
                    ->prepend('<i class="fa fa-thin fa-file"></i>')
                    ->nickname('order')
                    ->data('permission', 'order-list')
                    ->link->attr(['class' => ''])
                    ->href('#order');
                }
            $menu->order->add('<span>'.__('message.all_order').'</span>', ['class' => 'sidebar-layout' ,'route' => 'order.index'])
                ->data('permission', 'order list')
                ->prepend('<i class="fa fa-list"></i>')
                ->link->attr(['class' => '']);

            if($scheduleCount == 0){
                $menu->order->add('<span>'.__('message.schedule_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'schedule']])
                    ->data('permission', 'order-list')
                    ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                    ->link->attr(['class' => '']);
            }else{

                $menu->order->add('<span>'.__('message.schedule_order').' ' . $schedule .'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'schedule']])
                    ->data('permission', 'order-list')
                    ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                    ->link->attr(['class' => '']);
            }

            $menu->order->add('<span>'.__('message.draft_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'draft']])
                ->data('permission', 'order-list')
                ->prepend('<i class="fa fa-hourglass-half"></i>')
                ->link->attr(['class' => '']);

            $menu->order->add('<span>'.__('message.today_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'today']])
                ->data('permission', 'order-list')
                ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                ->link->attr(['class' => '']);

            $requestCount = Order::where('status', 'create')->count();
            if($requestCount == 0){
            $menu->order->add('<span>'.__('message.pending_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'pending']])
                ->data('permission', 'order list')
                ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                ->link->attr(['class' => '']);
            }else{
            $count = '<span class="badge badge-pill badge-primary p-1  animate__animated animate__flash" id="requestCount">' . $requestCount . '</span>';
            $menu->order->add('<span>'.__('message.pending_order').' ' . $count . '</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'pending']])
                ->data('permission', 'order list')
                ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                ->link->attr(['class' => '']);
            }

            $menu->order->add('<span>'.__('message.inprogress_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'inprogress']])
                ->data('permission', 'order list')
                ->prepend('<i class="fa fa-bars-progress"></i>')
                ->link->attr(['class' => '']);

            $menu->order->add('<span>'.__('message.complete_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'complete']])
                ->data('permission', 'order list')
                ->prepend('<i class="fa fa-calendar-check"></i>')
                ->link->attr(['class' => '']);

            $menu->order->add('<span>'.__('message.cancel_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'cancel']])
                ->data('permission', 'order list')
                ->prepend('<i class="fa fa-ban"></i>')
                ->link->attr(['class' => '']);

            $menu->order->add('<span>'.__('message.orders_location').'</span>', ['class' => 'sidebar-layout' ,'route' => 'ordermap'])
                ->data('permission', 'order_location-add')
                ->prepend('<i class="fa fa-thumbtack"></i>')
                ->link->attr(['class' => '']);

            $clientPendingCount = User::where('user_type', 'client')->where('status', 1)
                ->where(function ($query) {
                    $query->whereNull('email_verified_at')->orWhereNull('otp_verify_at');
                })
                ->where(function ($query) {
                    $query->whereNotNull('email_verified_at')->orWhereNotNull('otp_verify_at');
                })
                ->count();
            if($clientPendingCount == 0){
            $menu->add('<span>'.__('message.users').'</span>', ['class' => ''])
                ->prepend('<i class="fa fa-user-tie"></i>')
                ->nickname('users')
                ->data('permission', 'users-list')
                ->link->attr(['class' => ''])
                ->href('#users');
                }else{
                    $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash" id="requestCount">' . $clientPendingCount . '</span>';
            $menu->add('<span>'.__('message.users').' ' . $count . '</span>', ['class' => ''])
                ->prepend('<i class="fa fa-user-tie"></i>')
                ->nickname('users')
                ->data('permission', 'users-list')
                ->link->attr(['class' => ''])
                ->href('#users');
                }

            $menu->users->add( '<span>'.__('message.users').'</span>', ['class' => request()->is('users/*/add') ? 'sidebar-layout active' : 'sidebar-layout' ,'route' => 'users.index'])
                ->data('permission', ['users-add','users-edit'])
                ->prepend('<i class="fa fa-user-tie"></i>')
                ->link->attr(['class' => '']);

            $menu->users->add('<span>' . __('message.active_list_form_title', ['form' => __('message.users')]) . '</span>',
                ['class' => 'sidebar-layout', 'route' => ['user.status', 'active']]
            )
            ->data('permission', 'users list')
            ->prepend('<i class="fa fa-user-check"></i>')
            ->link->attr(['class' => '']);

            $menu->users->add('<span>' . __('message.inactive_list_form_title', ['form' => __('message.users')]) . '</span>',
                ['class' => 'sidebar-layout', 'route' => ['user.status', 'inactive']])
                ->data('permission', 'users list')
                ->prepend('<i class="fa fa-user-clock"></i>')
                ->link->attr(['class' => '']);

            if($clientPendingCount == 0){
                $menu->users->add('<span>'.__('message.pending_list_form_title',['form' => __('message.users')]).'</span>',  ['class' => 'sidebar-layout' ,'route' => ['user.status', 'status' => 'pending']])
                    ->data('permission', 'users list')
                    ->prepend('<i class="fa fa-user-pen"></i>')
                    ->link->attr(['class' => '']);
            }else{
                $count = '<span class="badge badge-pill badge-primary p-1  animate__animated animate__flash" id="requestCount">' . $clientPendingCount . '</span>';
                $menu->users->add('<span>'.__('message.pending_list_form_title',['form' => __('message.users')]).' ' . $count . '</span>',  ['class' => 'sidebar-layout' ,'route' => ['user.status', 'status' => 'pending']])
                    ->data('permission', 'users list')
                    ->prepend('<i class="fa fa-user-pen"></i>')
                    ->link->attr(['class' => '']);
            }
                
            $deliveryManPendingCount = User::where('user_type','delivery_man')->where('status', 1)
                ->where(function ($query) {
                    $query->whereNull('email_verified_at')->orWhereNull('otp_verify_at')->orWhereNull('document_verified_at');
                    $query->whereNotNull('email_verified_at')->orWhereNotNull('otp_verify_at')->orWhereNotNull('document_verified_at');
                })->count();
            if($deliveryManPendingCount == 0){
                $menu->add('<span>'.__('message.delivery_man').'</span>', ['class' => ''])
                    ->prepend('<i class="fa fa-user-tie"></i>')
                    ->nickname('delivery_man')
                    ->data('permission', 'delivery_man-list')
                    ->link->attr(['class' => ''])
                    ->href('#users');
            }else{
                $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash" id="requestCount">' . $deliveryManPendingCount . '</span>';
                $menu->add('<span>'.__('message.delivery_man').' ' . $count . '</span>', ['class' => ''])
                    ->prepend('<i class="fa fa-user-tie"></i>')
                    ->nickname('delivery_man')
                    ->data('permission', 'delivery_man-list')
                    ->link->attr(['class' => ''])
                    ->href('#users');
            }

            $menu->delivery_man->add( '<span>'.__('message.delivery_man').'</span>', ['class' => request()->is('delivery_man/*/add') ? 'sidebar-layout active' : 'sidebar-layout' ,'route' => 'deliveryman.index'])
                ->data('permission', ['delivery_man-add','delivery_man-edit'])
                ->prepend('<i class="fa fa-user-tie"></i>')
                ->link->attr(['class' => '']);

            $menu->delivery_man->add('<span>' . __('message.active_list_form_title', ['form' => __('message.delivery_man')]) . '</span>',
                ['class' => 'sidebar-layout', 'route' => ['deliveryman.pending', 'active']])
            ->data('permission', 'delivery_man list')
            ->prepend('<i class="fa fa-user-check"></i>')
            ->link->attr(['class' => '']);

            $menu->delivery_man->add('<span>' . __('message.inactive_list_form_title', ['form' => __('message.delivery_man')]) . '</span>',
                ['class' => 'sidebar-layout', 'route' => ['deliveryman.pending', 'inactive']])
                ->data('permission', 'delivery_man list')
                ->prepend('<i class="fa fa-user-clock"></i>')
                ->link->attr(['class' => '']);

            if($deliveryManPendingCount == 0){
                $menu->delivery_man->add('<span>'.__('message.pending_list_form_title',['form' => __('message.delivery_man')]).'</span>',  ['class' => 'sidebar-layout' ,'route' => ['deliveryman.pending', 'status' => 'pending']])
                    ->data('permission', 'delivery_man list')
                    ->prepend('<i class="fa fa-user-pen"></i>')
                    ->link->attr(['class' => '']);
            }else{
                $count = '<span class="badge badge-pill badge-primary p-1  animate__animated animate__flash" id="requestCount">' . $deliveryManPendingCount . '</span>';
                $menu->delivery_man->add('<span>'.__('message.pending_list_form_title',['form' => __('message.delivery_man')]).' ' . $count . '</span>',  ['class' => 'sidebar-layout' ,'route' => ['deliveryman.pending', 'status' => 'pending']])
                    ->data('permission', 'delivery_man list')
                    ->prepend('<i class="fa fa-user-pen"></i>')
                    ->link->attr(['class' => '']);
            }

            $menu->delivery_man->add('<span>'.__('message.deliverymandocument').'</span>', ['class' => request()->is('delivery_man/*/add') ? 'sidebar-layout active' : 'sidebar-layout' ,'route' => 'deliverymandocument.index'])
                    ->data('permission', ['deleverymandocument-add','deleverymandocument-edit'])
                    ->prepend('<i class="fa fa-id-card"></i>')
                    ->link->attr(['class' => '']);

            $menu->delivery_man->add('<span>'.__('message.require_document').'</span>', ['class' => 'sidebar-layout' ,'route' => 'document.index'])
                    ->data('permission', 'document-add')
                    ->prepend('<i class="fa fa-file"></i>')
                    ->link->attr(['class' => '']);
            $menu->delivery_man->add('<span>'.__('message.delivery_man_location').'</span>', ['class' => 'sidebar-layout' ,'route' => 'deliveryman-location'])
                    ->data('permission', 'delivery_boy_location-add')
                    ->prepend('<i class="fa fa-thumbtack"></i>')
                    ->link->attr(['class' => '']);

                //     $status_verify = Setting::where('type', 'storetype_verification')->first();
                //     if ($status_verify && $status_verify->value == 1) {
                //        $menu->add('<span>'.__('message.store').'</span>', ['class' => ''])
                //                ->prepend('<i class="fa-solid fa-store"></i>')
                //                ->nickname('store')
                //                ->data('permission', 'store list')
                //                ->link->attr(['class' => ''])
                //                ->href('#store');

                //        $menu->store->add('<span>'.__('message.storeowner').'</span>', ['class' => 'sidebar-layout' ,'route' => 'store-owner.index'])
                //            ->data('permission', 'storeowner list')
                //            ->prepend('<i class="fa fa-list"></i>')
                //            ->link->attr(['class' => '']);

                //        $menu->store->add('<span>'.__('message.all_store').'</span>', ['class' => 'sidebar-layout' ,'route' => 'store.index'])
                //            ->data('permission', 'store list')
                //            ->prepend('<i class="fa fa-list"></i>')
                //            ->link->attr(['class' => '']);

                //        $menu->store->add('<span>'.__('message.all_order').'</span>', ['class' => 'sidebar-layout' ,'route' => 'store-order-list'])
                //            ->data('permission', 'store list')
                //            ->prepend('<i class="fa fa-list"></i>')
                //            ->link->attr(['class' => '']);

                //        $menu->store->add('<span>'. __('message.storetype').'</span>', ['class' => request()->is('store/*/edit') ? 'sidebar-layout active' : 'sidebar-layout' ,'route' => 'storetype.index'])
                //            ->data('permission', 'storetype list')
                //            ->prepend('<i class="fa fa-list"></i>')
                //            ->link->attr(['class' => '']);
                //    }else{

                //    }

            $menu->add('<span>'.__('message.vehicle').'</span>', ['class' => ''])
                ->prepend('<i class="fa fa-car"></i>')
                ->nickname('vehicle')
                ->data('permission', 'vehicle list')
                ->link->attr(['class' => ''])
                ->href('#vehicle');

            $menu->vehicle->add('<span>'.__('message.add_form_title',['form' => __('message.vehicle')]).'</span>', ['class' => request()->is('country/*/edit') ? 'sidebar-layout active' : 'sidebar-layout' ,'route' => 'vehicle.create'])
                ->data('permission', [ 'add-vehicle', 'vehicle-edit'])
                ->prepend('<i class="fas fa-plus-square"></i>')
                ->link->attr(['class' => '']);

            $menu->vehicle->add('<span>'.__('message.list_form_title',['form' => __('message.vehicle')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'vehicle.index'])
                ->data('permission', 'vehicle list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.extracharge').'</span>', ['class' => ''])
                ->prepend('<i class="fas fa-comment-dollar"></i>')
                ->nickname('extracharge')
                ->data('permission', 'extracharge list')
                ->link->attr(['class' => ''])
                ->href('#extracharge');

            $menu->extracharge->add('<span>'.__('message.add_form_title',['form' => __('message.extracharge')]).'</span>', ['class' => request()->is('country/*/edit') ? 'sidebar-layout active' : 'sidebar-layout' ,'route' => 'extracharge.create'])
                ->data('permission', [ 'add-extracharge', 'extracharge-edit'])
                ->prepend('<i class="fas fa-plus-square"></i>')
                ->link->attr(['class' => '']);

            $menu->extracharge->add('<span>'.__('message.list_form_title',['form' => __('message.extracharges')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'extracharge.index'])
                ->data('permission', 'extracharge list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.parceltype').'</span>', ['class' => ''])
                ->prepend('<i class="fa-sharp fa fa-box"></i>')
                ->nickname('staticdata')
                ->data('permission', 'staticdata list')
                ->link->attr(['class' => ''])
                ->href('#staticdata');

            $menu->staticdata->add('<span>'.__('message.list_form_title',['form' => __('message.parceltype')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'staticdata.index'])
                ->data('permission', 'staticdata list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);


            $requestCount = WithdrawRequest::where('status', 'requested')->count() ?? 0;
            if($requestCount == 0){

                $menu->add('<span>'.__('message.withdrawrequest').'</span>', ['class' => ''])
                    ->prepend('<i class="fas fa-comment-dollar"></i>')
                    ->nickname('withdrawrequest')
                    ->data('permission', 'withdrawrequest-list')
                    ->link->attr(['class' => ''])
                    ->href('#withdrawrequest');
             }else{

                $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash" id="requestCount">' . $requestCount . '</span>';
                $menu->add('<span>'.__('message.withdrawrequest').' ' . $count .'</span>', ['class' => ''])
                    ->prepend('<i class="fas fa-comment-dollar"></i>')
                    ->nickname('withdrawrequest')
                    ->data('permission', 'withdrawrequest-list')
                    ->link->attr(['class' => ''])
                    ->href('#withdrawrequest');
            }

            $menu->withdrawrequest->add('<span>'.__('message.all').'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type' => 'all']])
                ->data('permission', 'withdrawrequest-list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            $requestCount = WithdrawRequest::where('status', 'requested')->count() ?? 0;
            if($requestCount == 0){
                $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.pending')]).'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'pending']])
                    ->data('permission', 'withdrawrequest-list')
                    ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                    ->link->attr(['class' => '']);

            }else{

                $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash" id="requestCount">' . $requestCount . '</span>';
                $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.pending')]).' ' . $count .'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'pending']])
                    ->data('permission', 'withdrawrequest-list')
                    ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                    ->link->attr(['class' => '']);
            }

            $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.approved')]).'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'approved']])
                ->data('permission', 'withdrawrequest-list')
                ->prepend('<i class="fa fa-calendar-check"></i>')
                ->link->attr(['class' => '']);

            $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.cencel')]).'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'decline']])
                ->data('permission', 'withdrawrequest-list')
                ->prepend('<i class="fa fa-ban"></i>')
                ->link->attr(['class' => '']);


            $menu->add('<span>'.__('message.pushnotification').'</span>', ['class' => ''])
                    ->prepend('<i class="fas fa-bullhorn"></i>')
                    ->nickname('pushnotification')
                    ->data('permission', 'push notification-list')
                    ->link->attr(['class' => ''])
                    ->href('#pushnotification');

            $menu->pushnotification->add('<span>'.__('message.list_form_title',['form' => __('message.pushnotification')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'pushnotification.index'])
                ->data('permission', 'push notification-list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            $menu->pushnotification->add('<span>'. __('message.send_pushnotification').'</span>', ['class' => 'sidebar-layout' ,'route' => 'pushnotification.create'])
                ->data('permission', [ 'push notification-add', 'push notification-edit'])
                ->prepend('<i class="fas fa-plus-square"></i>')
                ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.account_setting').'</span>', ['class' => ''])
                ->prepend('<i class="fas fa-users-cog"></i>')
                ->nickname('account_setting')
                ->data('permission', ['role-list','permission-list'])
                ->link->attr(["class" => ""])
                ->href('#account_setting');

            $menu->account_setting->add('<span>'.__('message.list_form_title',['form' => __('message.role')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'role.index'])
                ->data('permission', 'role-list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            $menu->account_setting->add('<span>'.__('message.list_form_title',['form' => __('message.permission')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'permission.index'])
                ->data('permission', 'permission-list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.report').'</span>', ['class' => ''])
                ->prepend('<i class="fa fa-address-book"></i>')
                ->nickname('report')
                ->data('permission', 'report')
                ->link->attr(['class' => ''])
                ->href('#report');

                $menu->report->add('<span>'.__('message.order_report').'</span>', ['class' => 'sidebar-layout' ,'route' => 'order-of-report'])
                    ->data('permission', 'order_report')
                    ->prepend('<i class="fas fa-file-contract"></i>')
                    ->link->attr(['class' => '']);

                $menu->report->add('<span>'.__('message.admin_earning_report').'</span>', ['class' => 'sidebar-layout' ,'route' => 'report-adminEarning'])
                    ->data('permission', 'admin_earning_report')
                    ->prepend('<i class="fas fa-file-contract"></i>')
                    ->link->attr(['class' => '']);

                $menu->report->add('<span>'.__('message.deliveryman_earning_report').'</span>', ['class' => 'sidebar-layout' ,'route' => 'report-deliverymanEarning'])
                    ->data('permission', 'deliveryman_earning_report')
                    ->prepend('<i class="fas fa-file-contract"></i>')
                    ->link->attr(['class' => '']);

                $menu->report->add('<span>'.__('message.delivery_man_wise_report').'</span>', ['class' => 'sidebar-layout' ,'route' => 'report-of-deliveryman'])
                    ->data('permission', 'delivery_man_wise_report')
                    ->prepend('<i class="fas fa-file-contract"></i>')
                    ->link->attr(['class' => '']);

                $menu->report->add('<span>'.__('message.user_wise_report').'</span>', ['class' => 'sidebar-layout' ,'route' => 'report-of-user'])
                    ->data('permission', 'user_wise_report')
                    ->prepend('<i class="fas fa-file-contract"></i>')
                    ->link->attr(['class' => '']);

                $menu->report->add('<span>'.__('message.city_wise_report').'</span>', ['class' => 'sidebar-layout' ,'route' => 'report-of-city'])
                    ->data('permission', 'city_wise_report')
                    ->prepend('<i class="fas fa-file-contract"></i>')
                    ->link->attr(['class' => '']);

                $menu->report->add('<span>'.__('message.country_wise_report').'</span>', ['class' => 'sidebar-layout' ,'route' => 'report-of-country'])
                    ->data('permission', 'country_wise_report')
                    ->prepend('<i class="fas fa-file-contract"></i>')
                    ->link->attr(['class' => '']);

                // $menu->report->add('<span>'.__('message.store_wise_store').'</span>', ['class' => 'sidebar-layout' ,'route' => 'report-of-store'])
                //     ->data('permission', 'report_of_store')
                //     ->prepend('<i class="fas fa-file-contract"></i>')
                //     ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.pages').'</span>', ['class' => ''])
                    ->prepend('<i class="fas fa-file"></i>')
                    ->nickname('pages')
                    ->data('permission', 'pages')
                    ->link->attr(['class' => ''])
                    ->href('#pages');
                $menu->pages->add('<span>'.__('message.list').'</span>', ['class' => 'sidebar-layout' ,'route' => 'pages.index'])
                    ->data('permission', 'page List')
                    ->prepend('<i class="fas fa-file-contract"></i>')
                    ->link->attr(['class' => '']);

                $menu->pages->add('<span>'.__('message.terms_condition').'</span>', ['class' => 'sidebar-layout' ,'route' => 'term-condition'])
                    ->data('permission', 'terms condition')
                    ->prepend('<i class="fas fa-file-contract"></i>')
                    ->link->attr(['class' => '']);

                $menu->pages->add('<span>'.__('message.privacy_policy').'</span>', ['class' => 'sidebar-layout' ,'route' => 'privacy-policy'])
                    ->data('permission', 'privacy policy')
                    ->prepend('<i class="fas fa-user-shield"></i>')
                    ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.setting').'</span>', ['route' => 'setting.index'])
                    ->prepend('<i class="fas fa-cog"></i>')
                    ->nickname('setting')
                    ->data('permission', 'system setting');

            $menu->add('<span>'.__('message.app_language_setting').'</span>', [ 'class' => ''])
                ->prepend('<i class="fa fa-language"></i>')
                ->nickname('app_language_setting')
                ->data('permission', '')
                ->link->attr(['class' => ''])
                ->href('#app_language_setting');

            $menu->app_language_setting->add('<span>'.__('message.list_form_title',['form' => __('message.screen')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'screen.index'])
                ->data('permission', 'screen-list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            $menu->app_language_setting->add('<span>'.__('message.list_form_title',['form' => __('message.default_keyword')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'defaultkeyword.index'])
                    ->data('permission', 'defaultkeyword-list')
                    ->prepend('<i class="fas fa-list"></i>')
                    ->link->attr(['class' => '']);

            $menu->app_language_setting->add('<span>'.__('message.list_form_title',['form' => __('message.language')]).'</span>', ['class' => request()->is('languagelist/*/edit') || request()->is('languagelist/create') ? 'sidebar-layout active' : 'sidebar-layout' ,'route' => 'languagelist.index'])
                    ->data('permission', 'languagelist-list')
                    ->prepend('<i class="fas fa-list"></i>')
                    ->link->attr(['class' => '']);

            $menu->app_language_setting->add('<span>'.__('message.list_form_title',['form' => __('message.language_with_keyword')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'languagewithkeyword.index'])
                    ->data('permission', 'languagewithkeyword-list')
                    ->prepend('<i class="fas fa-list"></i>')
                    ->link->attr(['class' => '']);

            $menu->app_language_setting->add('<span>'.__('message.list_form_title',['form' => __('message.bulk_import_langugage_data')]).'</span>', ['class' => 'sidebar-layout' ,'route' => 'bulk.language.data'])
                    ->data('permission', 'bulkimport-list')
                    ->prepend('<i class="fas fa-list"></i>')
                    ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.website_section').'</span>', ['class' => ''])
                ->prepend('<i class="fas fa-globe-asia"></i>')
                ->nickname('website_section')
                ->data('permission', 'website_section list')
                ->link->attr(['class' => ''])
                ->href('#website_section');

            $menu->website_section->add('<span>'. __('message.infromation').'</span>', ['class' => 'sidebar-layout' ,'route' => ['frontend.website.form', 'app_content']])
                ->data('permission', 'information list')
                ->prepend('<i class="fas fa-file-alt"></i>')
                ->link->attr(['class' => '']);

            $menu->website_section->add('<span>'. __('message.whydelivery').'</span>', ['class' => 'sidebar-layout' ,'route' => 'whydelivery.index'])
                ->data('permission', 'whydelivery list')
                ->prepend('<i class="fas fa-truck"></i>')
                ->link->attr(['class' => '']);

            $menu->website_section->add('<span>'. __('message.clientreview').'</span>', ['class' => 'sidebar-layout' ,'route' => 'clientreview.index'])
                ->data('permission', 'clientreview list')
                ->prepend('<i class="fas fa-thumbs-up"></i>')
                ->link->attr(['class' => '']);

            $menu->website_section->add('<span>'. __('message.downloandapp').'</span>', ['class' => 'sidebar-layout' ,'route' => ['frontend.website.form', 'download_app']])
                ->data('permission', 'downloandapp list')
                ->prepend('<i class="fas fa-download"></i>')
                ->link->attr(['class' => '']);

            $menu->website_section->add('<span>'. __('message.deliverypartner').'</span>', ['class' => 'sidebar-layout' ,'route' => 'deliverypartner.index'])
                ->data('permission', 'deliverypartner list')
                ->prepend('<i class="fas fa-user-nurse"></i>')
                ->link->attr(['class' => '']);

            $menu->website_section->add('<span>'. __('message.contactinfo').'</span>', ['class' => 'sidebar-layout' ,'route' => ['frontend.website.form','contact_us']])
                ->data('permission', 'contactinfo list')
                ->prepend('<i class="fas fa-id-badge"></i>')
                ->link->attr(['class' => '']);

            $menu->website_section->add('<span>'. __('message.aboutus').'</span>', ['class' => 'sidebar-layout' ,'route' => ['frontend.website.form','about_us']])
                ->data('permission', 'aboutus list')
                ->prepend('<i class="fas fa-exclamation"></i>')
                ->link->attr(['class' => '']);

            $menu->website_section->add('<span>'. __('message.walkthrough').'</span>', ['class' => 'sidebar-layout' ,'route' => 'walkthrough.index'])
                ->data('permission', 'walkthrough list')
                ->prepend('<i class="fas fa-tv"></i>')
                ->link->attr(['class' => '']);

            $menu->website_section->add('<span>'. __('message.trackorder').'</span>', ['class' => 'sidebar-layout' ,'route' => ['frontend.website.form','track_order']])
                ->data('permission', 'trackorder list')
                ->prepend('<i class="fas fa-location-arrow"></i>')
                ->link->attr(['class' => '']);
        }

        // if (Auth::user() && Auth::user()->user_type == 'storeowner') {
        //     $storeowner = Auth()->user()->id;

        //     $menu->add('<span>'.__('message.dashboard').'</span>', ['route' => 'home'])
        //     ->prepend('<i class="fas fa-home"></i>')
        //     ->link->attr(['class' => '']);

        //     if( auth()->user()->store_detail_id != null){
        //         $menu->add('<span>'.__('message.category').'</span>', ['route' => 'category.index'])
        //         ->prepend('<i class="fa fa-layer-group"></i>')
        //         ->link->attr(['class' => '']);
        //     }else{
        //         $menu->add('<span>'.__('message.category').'</span>', ['route' => 'store.create'])
        //         ->prepend('<i class="fa fa-layer-group"></i>')
        //         ->link->attr(['class' => '']);
        //         session()->flash('message', __('Store Details Fill.'));
        //     }

        //     if( auth()->user()->store_detail_id != null){
        //         $menu->add('<span>'.__('message.subcategory').'</span>', ['route' => 'subcategory.index'])
        //         ->prepend('<i class="fa fa-layer-group"></i>')
        //         ->link->attr(['class' => '']);
        //     }else{
        //         $menu->add('<span>'.__('message.subcategory').'</span>', ['route' => 'store.create'])
        //         ->prepend('<i class="fa fa-layer-group"></i>')
        //         ->link->attr(['class' => '']);
        //     }

        //     $menu->add('<span>'.__('message.product').'</span>', ['route' => 'product.index'])
        //         ->prepend('<i class="fa fa-gift"></i>')
        //         ->link->attr(['class' => '']);


        //     $menu->add('<span>'.__('message.store-manage').'</span>', ['route' => 'store-manage.index'])
        //         ->prepend('<i class="fa fa-gift"></i>')
        //         ->link->attr(['class' => '']);

        //     $menu->add('<span>'.__('message.store').'</span>', ['route' => 'store.create'])
        //         ->prepend('<i class="fa-solid fa-store"></i>')
        //         ->link->attr(['class' => '']);

        //     $requestCount = Order::where('status', 'create')->whereNotNull('store_detail_id')->count() ?? 0;
        //     $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash">' . $requestCount . '</span>';

        //     if($requestCount == 0){

        //         $menu->add('<span>'.__('message.order').'</span>', ['class' => ''])
        //             ->prepend('<i class="fa fa-thin fa-file"></i>')
        //             ->nickname('order')
        //             // ->data('permission', 'order-list')
        //             ->link->attr(['class' => ''])
        //             ->href('#order');
        //     }else{

        //         $menu->add('<span>'.__('message.order').' ' . $count .'</span>', ['class' => ''])
        //             ->prepend('<i class="fa fa-thin fa-file"></i>')
        //             ->nickname('order')
        //             // ->data('permission', 'order-list')
        //             ->link->attr(['class' => ''])
        //             ->href('#order');
        //     }

        //         $menu->order->add('<span>'.__('message.all_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'all_order']])
        //             // ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-list"></i>')
        //             ->link->attr(['class' => '']);

        //         $menu->order->add('<span>'.__('message.today_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'today']])
        //             // ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-clock-rotate-left"></i>')
        //             ->link->attr(['class' => '']);

        //         if($requestCount == 0){
        //             $menu->order->add('<span>'.__('message.pending_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'pending']])
        //                 // ->data('permission', 'order-list')
        //                 ->prepend('<i class="fa fa-clock-rotate-left"></i>')
        //                 ->link->attr(['class' => '']);
        //         }else{

        //             $menu->order->add('<span>'.__('message.pending_order').' ' . $count .'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'pending']])
        //                 // ->data('permission', 'order-list')
        //                 ->prepend('<i class="fa fa-clock-rotate-left"></i>')
        //                 ->link->attr(['class' => '']);
        //         }


        //         $menu->order->add('<span>'.__('message.inprogress_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'inprogress']])
        //             // ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-bars-progress"></i>')
        //             ->link->attr(['class' => '']);

        //         $menu->order->add('<span>'.__('message.complete_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'complete']])
        //             // ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-calendar-check"></i>')
        //             ->link->attr(['class' => '']);

        //         $menu->order->add('<span>'.__('message.cancel_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'cancel']])
        //             // ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-ban"></i>')
        //             ->link->attr(['class' => '']);


        //     if( auth()->user()->store_detail_id != null){
        //         $menu->add('<span>'.__('message.workhourmanage').'</span>', ['route' => 'work-hour-manage.index'])
        //     ->prepend('<i class="fa-solid fa-network-wired"></i>')
        //     ->link->attr(['class' => '']);
        //     }else{
        //         $menu->add('<span>'.__('message.workhourmanage').'</span>', ['route' => 'store.create'])
        //         ->prepend('<i class="fa fa-layer-group"></i>')
        //         ->link->attr(['class' => '']);
        //     }

        //     $menu->add('<span>'.__('message.bank_details').'</span>', ['route' => 'bank-details'])
        //     ->prepend('<i class="fas fa-building-columns"></i>')
        //     ->link->attr(['class' => '']);

        //     $requestCount = Order::where('status', 'create')->whereNotNull('store_detail_id')->count() ?? 0;
        //     if($requestCount == 0){
        //         $menu->add('<span>'.__('message.order').'</span>', ['class' => ''])
        //             ->prepend('<i class="fa fa-thin fa-file"></i>')
        //             ->nickname('order')
        //             ->data('permission', 'order-list')
        //             ->link->attr(['class' => ''])
        //             ->href('#order');
        //     }else{
        //         $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash">' . $requestCount . '</span>';
        //         $menu->add('<span>'.__('message.order').' ' . $count . '</span>', ['class' => ''])
        //                 ->prepend('<i class="fa fa-thin fa-file"></i>')
        //                 ->nickname('order')
        //                 ->data('permission', 'order-list')
        //                 ->link->attr(['class' => ''])
        //                 ->href('#order');
        //     }

        //         $menu->order->add('<span>'.__('message.all_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'all_order']])
        //             ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-list"></i>')
        //             ->link->attr(['class' => '']);

        //         $menu->order->add('<span>'.__('message.today_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'today']])
        //             ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-clock-rotate-left"></i>')
        //             ->link->attr(['class' => '']);

        //     $requestCount = Order::where('status', 'create')->whereNotNull('store_detail_id')->count() ?? 0;
        //     if($requestCount == 0){
        //         $menu->order->add('<span>'.__('message.pending_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'pending']])
        //             ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-clock-rotate-left"></i>')
        //             ->link->attr(['class' => '']);
        //     }else{
        //         $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash">' . $requestCount . '</span>';
        //         $menu->order->add('<span>'.__('message.pending_order').' ' . $count .'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'pending']])
        //             ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-clock-rotate-left"></i>')
        //             ->link->attr(['class' => '']);
        //     }
        //         $menu->order->add('<span>'.__('message.inprogress_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'inprogress']])
        //             ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-bars-progress"></i>')
        //             ->link->attr(['class' => '']);

        //         $menu->order->add('<span>'.__('message.complete_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'complete']])
        //             ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-calendar-check"></i>')
        //             ->link->attr(['class' => '']);

        //         $menu->order->add('<span>'.__('message.cancel_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['storeowner-order-list','orders_type'=>'cancel']])
        //             ->data('permission', 'order-list')
        //             ->prepend('<i class="fa fa-ban"></i>')
        //             ->link->attr(['class' => '']);



        //     $requestCount = WithdrawRequest::where('user_id',$storeowner)->where('status','requested')->count() ?? 0;
        //     $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash" id="requestCount">' . $requestCount . '</span>';

        //     if($requestCount == 0){

        //         $menu->add('<span>'.__('message.withdrawrequest').'</span>', ['class' => ''])
        //             ->prepend('<i class="fas fa-comment-dollar"></i>')
        //             ->nickname('withdrawrequest')
        //             // ->data('permission', 'withdrawrequest-list')
        //             ->link->attr(['class' => ''])
        //             ->href('#withdrawrequest');
        //         }else{

        //          $menu->add('<span>'.__('message.withdrawrequest').' ' . $count .'</span>', ['class' => ''])
        //             ->prepend('<i class="fas fa-comment-dollar"></i>')
        //             ->nickname('withdrawrequest')
        //             // ->data('permission', 'withdrawrequest-list')
        //             ->link->attr(['class' => ''])
        //             ->href('#withdrawrequest');
        //     }

        //     $menu->withdrawrequest->add('<span>'.__('message.all').'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'all']])
        //         // ->data('permission', 'withdrawrequest-list')
        //         ->prepend('<i class="fas fa-list"></i>')
        //         ->link->attr(['class' => '']);

        //     if($requestCount == 0){
        //         $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.pending')]).'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'pending']])
        //             // ->data('permission', 'withdrawrequest-list')
        //             ->prepend('<i class="fa fa-clock-rotate-left"></i>')
        //             ->link->attr(['class' => '']);
        //     }else{
        //         $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.pending')]).' ' . $count .'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'pending']])
        //             // ->data('permission', 'withdrawrequest-list')
        //             ->prepend('<i class="fa fa-clock-rotate-left"></i>')
        //             ->link->attr(['class' => '']);
        //     }

        //     $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.approved')]).'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'approved']])
        //         // ->data('permission', 'withdrawrequest-list')
        //         ->prepend('<i class="fa fa-calendar-check"></i>')
        //         ->link->attr(['class' => '']);

        //     $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.cencel')]).'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'decline']])
        //         // ->data('permission', 'withdrawrequest-list')
        //         ->prepend('<i class="fa fa-ban"></i>')
        //         ->link->attr(['class' => '']);
        // }

        if (Auth::user() && Auth::user()->user_type == 'client') {
            $client = Auth()->user();
            $requestCount = Order::where('client_id',auth()->id())->where('status', 'create')->count() ?? 0;
            $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash" id="requestCount">' . $requestCount . '</span>';

            if($requestCount == 0){

                $menu->add('<span>'.__('message.order') .'</span>', ['class' => ''])
                    ->prepend('<i class="fa fa-thin fa-file"></i>')
                    ->nickname('order')
                    // ->data('permission', 'order-list')
                    ->link->attr(['class' => ''])
                    ->href('#order');
            }else{
                $menu->add('<span>'.__('message.order'). ' ' . $count .'</span>', ['class' => ''])
                    ->prepend('<i class="fa fa-thin fa-file"></i>')
                    ->nickname('order')
                    // ->data('permission', 'order-list')
                    ->link->attr(['class' => ''])
                    ->href('#order');
            }

            $menu->order->add('<span>'.__('message.all_order').'</span>', ['class' => 'sidebar-layout' ,'route' => 'home'])
                // ->data('permission', 'order-list')
                ->prepend('<i class="fa fa-list"></i>')
                ->link->attr(['class' => '']);

            $menu->order->add('<span>'.__('message.today_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'today']])
                // ->data('permission', 'order-list')
                ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                ->link->attr(['class' => '']);

            if($requestCount == 0){
                $menu->order->add('<span>'.__('message.pending_order') .'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'pending']])
                    // ->data('permission', 'order-list')
                    ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                    ->link->attr(['class' => '']);
            }else{

                $menu->order->add('<span>'.__('message.pending_order'). ' ' . $count .'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'pending']])
                    // ->data('permission', 'order-list')
                    ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                    ->link->attr(['class' => '']);
            }

            $menu->order->add('<span>'.__('message.inprogress_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'inprogress']])
                // ->data('permission', 'order-list')
                ->prepend('<i class="fa fa-bars-progress"></i>')
                ->link->attr(['class' => '']);

            $menu->order->add('<span>'.__('message.complete_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'complete']])
                // ->data('permission', 'order-list')
                ->prepend('<i class="fa fa-calendar-check"></i>')
                ->link->attr(['class' => '']);

            $menu->order->add('<span>'.__('message.cancel_order').'</span>', ['class' => 'sidebar-layout' ,'route' => ['order.index','orders_type'=>'cancel']])
                // ->data('permission', 'order-list')
                ->prepend('<i class="fa fa-ban"></i>')
                ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.draft').'</span>', ['route' => 'draft-order'])
            ->prepend('<i class="fa fa-hourglass-half"></i>')
            ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.wallet').'</span>', ['route' => 'clientwallet'])
            ->prepend('<i class="fa fa-wallet"></i>')
            ->link->attr(['class' => '']);

            $requestCount = WithdrawRequest::where('user_id',$client->id)->where('status','requested')->count() ?? 0;
            $count = '<span class="badge badge-pill badge-primary p-1 mr-3 animate__animated animate__flash" id="requestCount">' . $requestCount . '</span>';

            if($requestCount == 0){
                $menu->add('<span>'.__('message.withdrawrequest').'</span>', ['class' => ''])
                    ->prepend('<i class="fas fa-comment-dollar"></i>')
                    ->nickname('withdrawrequest')
                    // ->data('permission', 'withdrawrequest')
                    ->link->attr(['class' => ''])
                    ->href('#withdrawrequest');
            }else{

                $menu->add('<span>'.__('message.withdrawrequest').' ' . $count .'</span>', ['class' => ''])
                    ->prepend('<i class="fas fa-comment-dollar"></i>')
                    ->nickname('withdrawrequest')
                    // ->data('permission', 'withdrawrequest')
                    ->link->attr(['class' => ''])
                    ->href('#withdrawrequest');
            }

            $menu->withdrawrequest->add('<span>'.__('message.all').'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'all']])
                // ->data('permission', 'withdrawrequest-list')
                ->prepend('<i class="fas fa-list"></i>')
                ->link->attr(['class' => '']);

            if($requestCount == 0){
                $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.pending')]).'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'pending']])
                    // ->data('permission', 'withdrawrequest-list')
                    ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                    ->link->attr(['class' => '']);
            }else{
                $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.pending')]).' ' . $count .'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'pending']])
                    // ->data('permission', 'withdrawrequest-list')
                    ->prepend('<i class="fa fa-clock-rotate-left"></i>')
                    ->link->attr(['class' => '']);
            }

            $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.approved')]).'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'approved']])
                // ->data('permission', 'withdrawrequest-list')
                ->prepend('<i class="fa fa-calendar-check"></i>')
                ->link->attr(['class' => '']);

            $menu->withdrawrequest->add('<span>'.__('message.list_form_title',['form' => __('message.decline')]).'</span>', ['class' => 'sidebar-layout' ,'route' => ['withdrawrequest.index','withdraw_type'=>'decline']])
                // ->data('permission', 'withdrawrequest-list')
                ->prepend('<i class="fa fa-ban"></i>')
                ->link->attr(['class' => '']);

             $menu->add('<span>'.__('message.bank_details').'</span>', ['route' => 'bankdeatils'])
            ->prepend('<i class="fa fa-landmark"></i>')
            ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.my_address').'</span>',['route' => 'useraddress.index'])
            ->prepend('<i class="fa fa-address-book"></i>')
            ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.change_password').'</span>',['route' => 'passwordpage'])
            ->prepend('<i class="fa fa-lock"></i>')
            ->link->attr(['class' => '']);

            $menu->add('<span>'.__('message.app_setting').'</span>',['route' => 'appsetting'])
            ->prepend('<i class="fa fa-user-minus"></i>')
            ->link->attr(['class' => '']);
        }

        })->filter(function ($item) {
            return checkMenuRoleAndPermission($item);
        });
?>

<div class="mm-sidebar sidebar-default">
    <div class="mm-sidebar-logo d-flex align-items-center justify-content-between">
        <a href="<?php echo e(route('home')); ?>" class="header-logo">
            <img src="<?php echo e(getSingleMedia(appSettingData('get'),'site_logo',null)); ?>" class="img-fluid mode light-img rounded-normal light-logo site_logo_preview" alt="logo">
            <img src="<?php echo e(getSingleMedia(appSettingData('get'),'site_dark_logo',null)); ?>" class="img-fluid mode dark-img rounded-normal darkmode-logo site_dark_logo_preview" alt="dark-logo">
        </a>
        <div class="side-menu-bt-sidebar">
            <i class="fas fa-bars wrapper-menu"></i>
        </div>
    </div>

    <div class="data-scrollbar" data-scroll="1">
        <nav class="mm-sidebar-menu">
            <ul id="mm-sidebar-toggle" class="side-menu">
                <?php echo $__env->make(config('laravel-menu.views.bootstrap-items'), ['items' => $MyNavBar->roots()], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            </ul>
        </nav>
        <div class="pt-5 pb-5"></div>
    </div>
</div>
<?php /**PATH /www/wwwroot/mxunzo.atharvatek.com/resources/views/partials/_body_sidebar.blade.php ENDPATH**/ ?>