<?php

// Dashboard
Breadcrumbs::for('home', function ($trail) {
    $trail->push('Dashboard', route('home'));
});

// Call Center
Breadcrumbs::for('call center', function ($trail) {
    $trail->parent('home');

    $trail->push('Call Center', route('callcenter'));
});

// Dashboard > Branch
Breadcrumbs::for('branch', function ($trail) {
    $trail->parent('home');
    $trail->push('Manage Branch', route('branch'));
});

// Dashboard > Branch
Breadcrumbs::for('plot', function ($trail) {
    $trail->parent('home');
    $trail->push('Plots', route('plots'));
});

// Dashboard > Manage Customer
Breadcrumbs::for('profile', function ($trail) {
    $trail->parent('home');
    $trail->push('User Profile', route('profile'));
});

// Dashboard > Manage Customer
Breadcrumbs::for('customer', function ($trail) {
    $trail->parent('home');
    $trail->push('Manage Customer', route('user.customers'));
});


// Dashboard > Manage Employee
Breadcrumbs::for('employee', function ($trail) {
    $trail->parent('hr');
    $trail->push('Manage Employee', route('user.employees'));
});
// Manage Employee > Manage Employee Assets
Breadcrumbs::for('employeeasset', function ($trail,$id,$name) {
    $trail->parent('employee');
    $trail->push(ucwords($name), route('employee.assets',$id));
});


// Dashboard > Manage Dealer
Breadcrumbs::for('dealer', function ($trail) {
    $trail->parent('home');
    $trail->push('Manage Dealer', route('user.dealers'));
});

// Dashboard > Manage Booking
Breadcrumbs::for('booking', function ($trail) {
    $trail->parent('home');
    $trail->push('Manage Booking', route('booking'));
});

// Dashboard > Manage Booking
Breadcrumbs::for('reserve_booking', function ($trail) {
    $trail->parent('home');
    $trail->push('Reserve Booking', route('booking.reserve'));
});

Breadcrumbs::for('view_user_permission', function ($trail,$name) {

    $trail->parent('home');
    $trail->push('View '.$name.' Permissions', route('permission.store'));
});


// Dashboard > Manage Booking > Booking Detail
Breadcrumbs::for('booking_detail', function ($trail,$id,$name) {
    $trail->parent('booking');

    $trail->push(ucwords($name), route('booking.details',$id));
});
// Dashboard > Cancel Booking > Booking Detail
Breadcrumbs::for('cancelbooking_detail', function ($trail,$id,$name) {
    $trail->parent('cancel');

    $trail->push(ucwords($name), route('bookingcancel.details',$id));
});

// Dashboard > Cancel Booking
Breadcrumbs::for('cancel', function ($trail) {
    $trail->parent('home');

    $trail->push('Cancel Booking', route('cancel'));
});
// Dashboard > Block Booking
Breadcrumbs::for('blockbooking', function ($trail) {
    $trail->parent('home');

    $trail->push('Block Booking', route('blockbooking'));
});
// Dashboard > Transfer Booking
Breadcrumbs::for('transfer', function ($trail) {
    $trail->parent('home');

    $trail->push('Transfer Booking', route('transfer'));
});

// Dashboard > Transfer Booking
Breadcrumbs::for('transfer_booking', function ($trail,$id,$name) {
    $trail->parent('booking');

    $trail->push(ucwords($name), route('booking.transfer',$id));
});




// Dashboard > Manage Voucher
Breadcrumbs::for('voucher', function ($trail) {

    $trail->parent('home');


    $trail->push('Manage Voucher', route('voucher'));
});

// Dashboard > Manage Voucher
Breadcrumbs::for('reject_voucher', function ($trail) {

    $trail->parent('home');


    $trail->push('Reject Voucher', route('rejectvoucher'));
});




// Dashboard > Manage Account / Head
Breadcrumbs::for('head', function ($trail) {

    $trail->parent('home');


    $trail->push('Chart of Accounts', route('head'));
});

// Dashboard > Manage Account / Head
Breadcrumbs::for('auto_coa', function ($trail) {

    $trail->parent('home');


    $trail->push('Chart of Accounts (Auto)', route('coaauto'));
});


// Dashboard > Manage Account / Head > Manage Subhead
Breadcrumbs::for('subhead', function ($trail,$breadcrumb) {

    $trail->parent('head');

    $trail->push(ucwords($breadcrumb['head_name'].' Head '), route('subhead',$breadcrumb['head_id']));
});

// Dashboard > Manage Account / Head > [Subhead] > View Ledger
Breadcrumbs::for('ledger', function ($trail,$breadcrumb) {

    $trail->parent('subhead',$breadcrumb);

    $trail->push(ucwords($breadcrumb['subhead_name'].' Ledger'), route('subhead.viewledger',$breadcrumb['subhead_id']));
});

// Dashboard > report
Breadcrumbs::for('report', function ($trail) {

    $trail->parent('home');

    $trail->push(('Report'), route('reports'));
});

// Dashboard > Logs
Breadcrumbs::for('logs', function ($trail) {

    $trail->parent('home');

    $trail->push(('System Logs'), route('logs'));
});

// Dashboard > hr
Breadcrumbs::for('hr', function ($trail) {

    $trail->parent('home');

    $trail->push(('HR'), route('hr'));
});

// Dashboard > hr
Breadcrumbs::for('departments', function ($trail) {

    $trail->parent('hr');

    $trail->push(('Departments'), route('departments'));
});
// Dashboard > hr > Department


// Dashboard > hr > Scale
Breadcrumbs::for('scales', function ($trail) {

    $trail->parent('hr');

    $trail->push(('Scales'), route('scales'));
});

// Dashboard > hr > Designation
Breadcrumbs::for('designation', function ($trail) {

    $trail->parent('hr');

    $trail->push(('Designation'), route('designation'));
});

// Dashboard > hr > Allowance
Breadcrumbs::for('allowance', function ($trail) {

    $trail->parent('hr');

    $trail->push(('Allowance'), route('allowance'));
});

// Dashboard > hr > Contract
Breadcrumbs::for('contract', function ($trail) {
   $trail->parent('hr');
   $trail->push(('Contract'), route('contract'));
});

// Dashboard > hr > Manage Contract > Booking Detail
Breadcrumbs::for('contractassignment', function ($trail,$id) {
    $trail->parent('contract');

    $trail->push(('Assign Asset/Allowance'), route('contracts.assignment',$id));
});

// Dashboard > hr > Loan
Breadcrumbs::for('loan', function ($trail) {
   $trail->parent('hr');
   $trail->push(('Loan'), route('loan'));
});


// Dashboard > hr > Leave
Breadcrumbs::for('leave', function ($trail) {
   $trail->parent('hr');
   $trail->push(('Leave'), route('leave'));
});

// Dashboard > hr > Setting
Breadcrumbs::for('setting', function ($trail) {
   $trail->parent('hr');
   $trail->push(('Setting'), route('setting'));
});



// Dashboard > hr > Deduction
Breadcrumbs::for('deduction', function ($trail) {
   $trail->parent('hr');
   $trail->push(('Deduction'), route('deduction'));
});

// Dashboard > hr > minutesheets
Breadcrumbs::for('minutesheets', function ($trail) {

    $trail->parent('hr');

    $trail->push(('Minute Sheet'), route('minutesheet'));
});

// Dashboard > Manage Minute Sheet > Minute Sheet Detail
Breadcrumbs::for('minute_sheet_detail', function ($trail,$id,$title) {
    $trail->parent('minutesheets');

    $trail->push(ucwords($title), route('minute_sheet.details',$id));
});


// Dashboard > hr > Tax
Breadcrumbs::for('tax', function ($trail) {

    $trail->parent('hr');

    $trail->push(('tax'), route('tax'));
});


// Dashboard > Letters
Breadcrumbs::for('letters', function ($trail) {
    $trail->parent('home');
    $trail->push('Letters', route('letters'));
});

// Dashboard > Manage Bank
Breadcrumbs::for('bank', function ($trail) {

    $trail->parent('home');
    $trail->push('Manage Bank', route('bank'));

});

// Dashboard > Manage Bank
Breadcrumbs::for('pending_payments', function ($trail) {

    $trail->parent('home');
    $trail->push('Pending Payments', route('pending_payments'));

});

// Dashboard > hr > Allowance
Breadcrumbs::for('asset', function ($trail) {

    $trail->parent('hr');

    $trail->push(('Asset'), route('asset'));
});

//INVENTORY BREADCRUMBS

// Dashboard > inventory
Breadcrumbs::for('inventory', function ($trail) {

    $trail->parent('home');

    $trail->push(('Inventory'), route('inventory'));
});

// Dashboard > inventory reports
Breadcrumbs::for('inventoryreports', function ($trail) {

    $trail->parent('home');

    $trail->push(('Inventory Reports'), route('intreports'));
});


// Dashboard > Inventory > Supplier
Breadcrumbs::for('supplier', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Manage Suppliers / Contractors', route('user.suppliers'));
});


// Dashboard > Inventory > Supplier
Breadcrumbs::for('userledger', function ($trail,$id) {
    $trail->parent('supplier');
    $trail->push('View Ledger', route('user.viewledger',$id));
});

Breadcrumbs::for('qoutation', function ($trail) {
    $trail->parent('supplier');
    $trail->push('Manage qoutation', route('user.suppliers'));
});



// Dashboard > Inventory > Items
Breadcrumbs::for('items', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Manage Items', route('item.items'));
});

// Dashboard > Inventory > Contractor
Breadcrumbs::for('contractor', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Manage Contractor', route('user.contractors'));
});

// Dashboard > Inventory > BOQFORM
Breadcrumbs::for('addboqform', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Add Bill Of Quantity', route('boq.addform'));
});

// Dashboard > Inventory > BOQFORM
Breadcrumbs::for('createpr', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Create Purchase Requistion', route('boq.addform'));
});

// Dashboard > Inventory > BOQManageRequest
Breadcrumbs::for('managepurchaserequisition', function ($trail,$id) {
    $trail->parent('purchaserequisition');
    $trail->push('Manage PR', route('boqrequest.details',$id));
});

Breadcrumbs::for('pocreate', function ($trail,$id) {
    $trail->parent('create po');
    $trail->push('Manage PO', route('porequest.details',$id));
});





// Dashboard > Inventory > BOQManageRequest
Breadcrumbs::for('boqdetails', function ($trail,$id) {
    $trail->parent('boqrequests');
    $trail->push('BOQ Request Details', route('boq.details',$id));
});

// Dashboard > Inventory > BOQ Requests
Breadcrumbs::for('boqrequests', function ($trail) {
    $trail->parent('inventory');
    $trail->push('BOQ Requests', route('boq.requests'));
});

// Dashboard > Inventory > BOQ Requests
Breadcrumbs::for('purchaserequisition', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Purchase Requisitions', route('boq.requests_pr'));
});

Breadcrumbs::for('create po', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Create PO', route('create.requests_po'));
});

Breadcrumbs::for('purchaserequisitiondetail', function ($trail) {
    $trail->parent('purchaserequisition');
    $trail->push('Purchase Requisition Details', route('boq.requests_pr'));
});

Breadcrumbs::for('podetals', function ($trail) {
    $trail->parent('create po');
    $trail->push('Purchase Order Details', route('boq.requests_pr'));
});

// Dashboard > Inventory > PurchaseOrder
Breadcrumbs::for('purchaseorder', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Manage Purchase Order', route('purchaseorders'));
});

// Dashboard > Inventory > PurchaseOrderdetail
Breadcrumbs::for('podetail', function ($trail,$id) {
    $trail->parent('purchaseorder');
    $trail->push('PO Detail', route('po.detail',$id));
});

// Dashboard > Inventory > GRN
Breadcrumbs::for('grn.view', function ($trail) {
    $trail->parent('inventory');
    $trail->push('GRN', route('grn.view'));
});

// Dashboard > Inventory > GIN
Breadcrumbs::for('gin.view', function ($trail) {
    $trail->parent('inventory');
    $trail->push('GIN', route('gin.view'));
});
// Dashboard > Inventory > Stock
Breadcrumbs::for('stock.view', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Stock', route('stock.view'));
});

// Dashboard > Inventory > Payable
Breadcrumbs::for('payable.view', function ($trail) {
    $trail->parent('inventory');
    $trail->push('Payable', route('payable.view'));
});


// Dashboard > Inventory > GRN generate
Breadcrumbs::for('grn.generate', function ($trail) {
    $trail->parent('inventory');
    $trail->push('GRN', route('grn.generate'));
});

// Dashboard > Inventory > BOQManageRequest
Breadcrumbs::for('stockdetails', function ($trail,$id) {
    $trail->parent('stock.view');
    $trail->push('Stock Details', route('stock.details',$id));
});

//BILLS AND PAYABLES
Breadcrumbs::for('billandpayments', function ($trail) {

    $trail->parent('home');
    $trail->push('Bill and Payments', route('billandpayments'));

});


Breadcrumbs::for('commit_bill', function ($trail) {

    $trail->parent('billandpayments');
    $trail->push('Add Bills', route('commit_bill'));

});

Breadcrumbs::for('show_bill_installments', function ($trail) {

    $trail->parent('commit_bill');
    $trail->push('Bill Details', route('show_bill_installments'));

});


// Dashboard > Vendor Dashboard
Breadcrumbs::for('vendormodule', function ($trail) {
    $trail->parent('home');
    $trail->push('Vendor Dashboard', route('vendormodule'));
});


Breadcrumbs::for('vendorreport', function ($trail) {
    $trail->parent('vendormodule');
    $trail->push('Vendor Ledger Report', route('vendorreport'));
});
// Dashboard > Vendor 
Breadcrumbs::for('vendor', function ($trail) {
    $trail->parent('vendormodule');
    $trail->push('Manage Vendor', route('vendors'));
});

// Dashboard > Vendor 
Breadcrumbs::for('invoice_payment', function ($trail) {
    $trail->parent('vendormodule');
    $trail->push('Payments', route('invoicepayments'));
});

// Dashboard > Vendor Invoice
Breadcrumbs::for('invoice', function ($trail) {
    $trail->parent('vendormodule');
    $trail->push('Manage Invoice', route('invoices'));
});
//  Dashboard > CRM 
Breadcrumbs::for('crm', function ($trail) {

    $trail->parent('home');
    $trail->push('CRM', route('crm'));

});

//  Dashboard > CRM > LEAD
Breadcrumbs::for('lead', function ($trail) {

    $trail->parent('crm');
    $trail->push('Manage Leads', route('lead.leads'));

});


Breadcrumbs::for('vendors', function ($trail) {

    $trail->parent('home');


    $trail->push('Vendors', route('vendors'));
});

// Breadcrumbs::for('task', function ($trail,$id) {

//     $trail->parent('crm');
//     $trail->push('Manage Task', route('task.tasks',$id));

// });