@php $current_route = $request->route()->getName(); $pending_count_for_price = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ($query) { $query->where('document_type', 1); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_mccTransfer = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ($query) { $query->where('document_type', 2); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_areaTransfer = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ($query) { $query->where('document_type', 3); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_supplierRegistration = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ($query) { $query->where('document_type', 4)->orWhere('document_type', 6); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_collectionPointRegistration = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 5); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_supplierUpdate = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ($query) { $query->where('document_type', 7)->orWhere('document_type', 9); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_collectionPointUpdate = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 8); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_iblPricingFixedPrice = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 10); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_iblPricingVariablePrice = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 11); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_generalExpense = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 12); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_fixedAssetAllocation = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 13); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_fixedAssetTransfer = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 14); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_fixedAssetMovement = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 15); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_fixedAssetScrap = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 16); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_targets = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 17); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_rental_agreements = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 18); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_cost_estimation1 = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 19); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_cost_estimation2 = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 20); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); $pending_count_for_cost_estimation3 = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ( $query ) { $query->where('document_type', 21); }) ->where('status', 0) ->where('data.role_id', $role) ->count(); @endphp