PHP code example of azaharizaman / nexus-warehouse

1. Go to this page and download the library: Download azaharizaman/nexus-warehouse library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

azaharizaman / nexus-warehouse example snippets


use Nexus\Warehouse\Contracts\PickingOptimizerInterface;

$optimizer = app(PickingOptimizerInterface::class);

// Optimize pick route
$result = $optimizer->optimizePickRoute(
    warehouseId: 'wh_001',
    pickItems: [
        ['bin_id' => 'bin_a1', 'product_id' => 'prod_1', 'quantity' => 10],
        ['bin_id' => 'bin_c5', 'product_id' => 'prod_2', 'quantity' => 5],
    ]
);

echo "Distance reduction: {$result->getDistanceImprovement()}%";