<?php

/***** 
// Marketing
*****/
Breadcrumbs::for('dashboard', function ($trail) {
    $trail->push('Home', route('dashboard'), ['icon' => 'fa fa-home']);
});

Breadcrumbs::for('mHome', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Dealers', route('mHome'), ['icon' => '']);
    $trail->push('Dealer List', route('mHome'), ['icon' => '']);
});

Breadcrumbs::for('addDealerForm', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Dealers', route('mHome'), ['icon' => '']);
    $trail->push('Add New Dealer', route('addDealerForm'), ['icon' => '']);
});

Breadcrumbs::for('agentFormMarketing', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Agents', route('agentList'), ['icon' => '']);
    $trail->push('Add New Main Agent', route('agentFormMarketing'), ['icon' => '']);
});

Breadcrumbs::for('agentList', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Agents', route('agentList'), ['icon' => '']);
    $trail->push('Agent List', route('agentList'), ['icon' => '']);
});

Breadcrumbs::for('commissionListR', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Commission List (R)', route('commissionListR'), ['icon' => '']);
    $trail->push('Commission List (R)', route('commissionListR'), ['icon' => '']);
});

Breadcrumbs::for('commissionListB', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Commission List (B)', route('commissionListB'), ['icon' => '']);
    $trail->push('Commission List (B)', route('commissionListB'), ['icon' => '']);
});

Breadcrumbs::for('commissionFormR', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Commission List (R)', route('commissionListR'), ['icon' => '']);
    $trail->push('Add New Comission (R)', route('commissionListR'), ['icon' => '']);
});

Breadcrumbs::for('commissionFormB', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Commission List (B)', route('commissionListB'), ['icon' => '']);
    $trail->push('Add New Comission (B)', route('commissionListB'), ['icon' => '']);
});

Breadcrumbs::for('editCompany', function ($trail, $company_id) {
    $trail->parent('dashboard');
    $trail->push('Dealers', route('mHome'), ['icon' => '']);
    $trail->push('Edit Dealer Detail', route('editCompany',['company_id' => $company_id]), ['icon' => '']);
});

Breadcrumbs::for('editCommissionR', function ($trail, $commission_id) {
    $trail->parent('dashboard');
    $trail->push('Commission List (R)', route('commissionListR'), ['icon' => '']);
    $trail->push('Edit Commission (R)', route('editCommissionR',['commission_id' => $commission_id]), ['icon' => '']);
});

Breadcrumbs::for('editCommissionB', function ($trail, $commission_id) {
    $trail->parent('dashboard');
    $trail->push('Commission List (B)', route('commissionListB'), ['icon' => '']);
    $trail->push('Edit Commission (B)', route('editCommissionB',['commission_id' => $commission_id]), ['icon' => '']);
});

Breadcrumbs::for('editAgent', function ($trail, $agent_id) {
    $trail->parent('dashboard');
    $trail->push('Agents', route('agentList'), ['icon' => '']);
    $trail->push('Edit Main Agent', route('editAgent',['agent_id' => $agent_id]), ['icon' => '']);
});

// Breadcrumbs::for('mClaimAll', function ($trail) {
//     $trail->parent('dashboard');
//     $trail->push('Agent List', route('agentList'), ['icon' => '']);
//     $trail->push('Claim Residential & Business', route('mClaimAll'), ['icon' => '']);
// });

Breadcrumbs::for('mClaimAll', function ($trail, $agent_id) {
    $trail->parent('dashboard');
    $trail->push('Agents', route('agentList'), ['icon' => '']);
    $trail->push('Claim Residential & Business', route('mClaimAll',['agent_id' => $agent_id]), ['icon' => '']);
});

Breadcrumbs::for('docketList', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Docket', route('docketList'), ['icon' => '']);
});

Breadcrumbs::for('woList', function ($trail) {
    $trail->parent('dashboard');
    $trail->push('Word Order', route('woList'), ['icon' => '']);
});





/***** 
// Dealer
*****/
Breadcrumbs::for('dHome', function ($trail) {
    $trail->push('Home', route('dHome'), ['icon' => 'fa fa-home']);
});

Breadcrumbs::for('addAgentForm', function ($trail) {
    $trail->parent('dHome');
    $trail->push('Add New Agent', route('addAgentForm'), ['icon' => '']);
});

Breadcrumbs::for('editAgentDealer', function ($trail, $agent_id) {
    $trail->parent('dHome');
    $trail->push('Edit Agent', route('editAgentDealer',['agent_id' => $agent_id]), ['icon' => '']);
});

Breadcrumbs::for('residentialForm', function ($trail) {
    $trail->parent('dHome');
    $trail->push('Application Form', '', ['icon' => '']);
    $trail->push('Residential Package', route('residentialForm'), ['icon' => '']);
});

Breadcrumbs::for('businessForm', function ($trail) {
    $trail->parent('dHome');
    $trail->push('Application Form', '', ['icon' => '']);
    $trail->push('Business Package', route('businessForm'), ['icon' => '']);
});

Breadcrumbs::for('AppList', function ($trail) {
    $trail->parent('dHome');
    $trail->push('Subsciption', '', ['icon' => '']);
    $trail->push('Subcription Form List', route('AppList'), ['icon' => '']);
});

// Breadcrumbs::for('claimResidential', function ($trail) {
//     $trail->parent('dHome');
//     $trail->push('Claim / Invoice', '', ['icon' => '']);
//     $trail->push('Residential', route('claimResidential'), ['icon' => '']);
// });

// Breadcrumbs::for('claimBusiness', function ($trail) {
//     $trail->parent('dHome');
//     $trail->push('Claim / Invoice', '', ['icon' => '']);
//     $trail->push('Business', route('claimBusiness'), ['icon' => '']);
// });

Breadcrumbs::for('claimAll', function ($trail) {
    $trail->parent('dHome');
    $trail->push('Claim / Invoice', '', ['icon' => '']);
    $trail->push('Residential & Business', route('claimAll'), ['icon' => '']);
});


/***** 
// Sales / Agent
*****/

Breadcrumbs::for('aHome', function ($trail) {
    $trail->push('Home', route('aHome'), ['icon' => 'fa fa-home']);
});

Breadcrumbs::for('residentialSForm', function ($trail) {
    $trail->parent('dHome');
    $trail->push('Application Form', '', ['icon' => '']);
    $trail->push('Residential Package', route('residentialSForm'), ['icon' => '']);
});

Breadcrumbs::for('businessSForm', function ($trail) {
    $trail->parent('dHome');
    $trail->push('Application Form', '', ['icon' => '']);
    $trail->push('Business Package', route('businessSForm'), ['icon' => '']);
});

Breadcrumbs::for('aProfile', function ($trail) {
    $trail->parent('dHome');
    $trail->push('Profile', route('aProfile'), ['icon' => '']);
});

/**
 * Contractor
 */
Breadcrumbs::for('conHome', function ($trail) {
    $trail->push('Home', route('conHome'), ['icon' => 'fa fa-home']);
});

Breadcrumbs::for('vContractorWork', function ($trail) {
    $trail->parent('conHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("List", route('vContractorWork'), ['icon' => '']);
});

Breadcrumbs::for('editContractorWork', function ($trail, $wo) {
    $trail->parent('conHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("Edit Work Order's Detail", route('editContractorWork',['wo' => $wo]), ['icon' => '']);
});

Breadcrumbs::for('vContractorDocket', function ($trail) {
    $trail->parent('conHome');
    $trail->push("Docket", '', ['icon' => '']);
    $trail->push("List", route('vContractorWork'), ['icon' => '']);
});

Breadcrumbs::for('vContractorTeam', function ($trail) {
    $trail->parent('conHome');
    $trail->push('CBB Teams', '', ['icon' => '']);
    $trail->push("Contractor's List", route('vContractorTeam'), ['icon' => '']);
});

Breadcrumbs::for('addInstaller', function ($trail) {
    $trail->parent('conHome');
    $trail->push('CBB Teams', '', ['icon' => '']);
    $trail->push("Add New Installer", route('addInstaller'), ['icon' => '']);
});

Breadcrumbs::for('vEditContractorTeam', function ($trail,$i_id) {
    $trail->parent('conHome');
    $trail->push('CBB Teams', '', ['icon' => '']);
    $trail->push("Edit Installer", '', ['icon' => '']);
    $trail->push($i_id, '', ['icon' => '']);
});

Breadcrumbs::for('vWorkOrderRescheduleC', function ($trail,$wo) {
    $trail->parent('csHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("Reschedule", '', ['icon' => '']);
    $trail->push($wo, '', ['icon' => '']);
});

/** Customer Service **/
Breadcrumbs::for('csHome', function ($trail) {
    $trail->push('Home', route('csHome'), ['icon' => 'fa fa-home']);
});

Breadcrumbs::for('csProfile', function ($trail) {
    $trail->parent('csHome');
    $trail->push('Profile', route('csProfile'), ['icon' => '']);
});

Breadcrumbs::for('gALLNewCustomer', function ($trail) {
    $trail->parent('csHome');
    $trail->push('Customers', '', ['icon' => '']);
    $trail->push("Customer List", route('gALLNewCustomer'), ['icon' => '']);
});

Breadcrumbs::for('editCustomerDetail', function ($trail,$subscriber_id) {
    $trail->parent('csHome');
    $trail->push('Edit', '', ['icon' => '']);
    $trail->push('Customers', '', ['icon' => '']);
    $trail->push($subscriber_id, '', ['icon' => '']);
});

Breadcrumbs::for('vAllSubcribers', function ($trail) {
    $trail->parent('csHome');
    $trail->push('Customers', '', ['icon' => '']);
    $trail->push("Subscribers List", route('vAllSubcribers'), ['icon' => '']);
});

Breadcrumbs::for('vWorkOrder', function ($trail) {
    $trail->parent('csHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("Work Order's List", route('vWorkOrder'), ['icon' => '']);
});

Breadcrumbs::for('viewCustomerWoFormR', function ($trail,$wo) {
    $trail->parent('csHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push('Edit', '', ['icon' => '']);
    $trail->push($wo, '', ['icon' => '']);
});

Breadcrumbs::for('vWorkOrderSchedule', function ($trail,$status,$wo,$subscriber_id) {
    $trail->parent('csHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("Add New Schedule", '', ['icon' => '']);
    $trail->push($wo, '', ['icon' => '']);
});

Breadcrumbs::for('vWorkOrderReschedule', function ($trail,$wo) {
    $trail->parent('csHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("Reschedule", '', ['icon' => '']);
    $trail->push($wo, '', ['icon' => '']);
});

Breadcrumbs::for('confirmWorkOrderSchedule', function ($trail,$wo) {
    $trail->parent('csHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("Confirm", '', ['icon' => '']);
    $trail->push($wo, '', ['icon' => '']);
});

Breadcrumbs::for('createWorkOrderR', function ($trail) {
    $trail->parent('csHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("Create Work Order (R)", route('createWorkOrderR'), ['icon' => '']);
});

Breadcrumbs::for('createWorkOrderB', function ($trail) {
    $trail->parent('csHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("Create Work Order (B)", route('createWorkOrderB'), ['icon' => '']);
});

Breadcrumbs::for('vDocket', function ($trail) {
    $trail->parent('csHome');
    $trail->push("Docket", route('vDocket'), ['icon' => '']);
});

Breadcrumbs::for('viewCustomerTeam', function ($trail) {
    $trail->parent('csHome');
    $trail->push('CBB Teams', '', ['icon' => '']);
    $trail->push("Contractor's List", route('viewCustomerTeam'), ['icon' => '']);
});

Breadcrumbs::for('viewCustomerContractorForm', function ($trail) {
    $trail->parent('csHome');
    $trail->push('CBB Teams', '', ['icon' => '']);
    $trail->push("Add New Contractor", route('viewCustomerContractorForm'), ['icon' => '']);
});

Breadcrumbs::for('viewEditContractor', function ($trail,$contractor) {
    $trail->parent('csHome');
    $trail->push('CBB Teams', '', ['icon' => '']);
    $trail->push("Contractor",'', ['icon' => '']); 
    $trail->push('Edit', '', ['icon' => '']);
    $trail->push($contractor, '', ['icon' => '']);
});

Breadcrumbs::for('viewCustomerVendor', function ($trail) {
    $trail->parent('csHome');
    $trail->push('CBB Teams', '', ['icon' => '']);
    $trail->push("Vendor's List", route('viewCustomerVendor'), ['icon' => '']);
});

Breadcrumbs::for('viewCustomerVendorForm', function ($trail) {
    $trail->parent('csHome');
    $trail->push('CBB Teams', '', ['icon' => '']);
    $trail->push("Add New Vendor", route('viewCustomerVendorForm'), ['icon' => '']);
});

Breadcrumbs::for('viewEditVendor', function ($trail,$vendor) {
    $trail->parent('csHome');
    $trail->push('CBB Teams', '', ['icon' => '']);
    $trail->push("Vendor",'', ['icon' => '']); 
    $trail->push('Edit', '', ['icon' => '']);
    $trail->push($vendor, '', ['icon' => '']);
});

Breadcrumbs::for('viewCoverageR', function ($trail) {
    $trail->parent('csHome');
    $trail->push('Coverage', '', ['icon' => '']);
    $trail->push("Coverage List (R)", route('viewCoverageR'), ['icon' => '']);
});

Breadcrumbs::for('viewCoverageB', function ($trail) {
    $trail->parent('csHome');
    $trail->push('Coverage', '', ['icon' => '']);
    $trail->push("Coverage List (B)", route('viewCoverageB'), ['icon' => '']);
});

Breadcrumbs::for('viewCoverageForm', function ($trail) {
    $trail->parent('csHome');
    $trail->push('Coverage', '', ['icon' => '']);
    $trail->push("Add New Coverage", route('viewCoverageForm'), ['icon' => '']);
});

Breadcrumbs::for('editCustomerWo', function ($trail, $id) {
    $trail->parent('csHome');
    $trail->push('Work Orders', '', ['icon' => '']);
    $trail->push("Edit Work Order Detail", route('editCustomerWo',['id' => $id]), ['icon' => '']);
});

Breadcrumbs::for('editCoverageR', function ($trail, $id) {
    $trail->parent('csHome');
    $trail->push('Coverage', '', ['icon' => '']);
     $trail->push('Residential', '', ['icon' => '']);
    $trail->push("Edit Coverage Detail", route('editCoverageR',['id' => $id]), ['icon' => '']);
});

Breadcrumbs::for('editCoverageB', function ($trail, $id) {
    $trail->parent('csHome');
    $trail->push('Coverage', '', ['icon' => '']);
     $trail->push('Business', '', ['icon' => '']);
    $trail->push("Edit Coverage Detail", route('editCoverageB',['id' => $id]), ['icon' => '']);
});