PHP code example of elgibor-solution / laravel-inventory

1. Go to this page and download the library: Download elgibor-solution/laravel-inventory 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/ */

    

elgibor-solution / laravel-inventory example snippets


'accounting' => [
    'enabled' => false,
    'connection' => null,
    'tenant_payload_key' => null,
    'service_code_map' => [
        'purchase_receipt' => 'PURCHASE_CREDIT',
        'warehouse_transfer.intra_company' => null,
    ],
],

use ESolution\Inventory\DTO\DocumentData;
use ESolution\Inventory\DTO\LineData;
use ESolution\Inventory\Facades\Inventory;

$document = Inventory::post(new DocumentData(
    type: 'purchase_receipt',
    organizationId: $organizationId,
    trxDate: now()->toDateString(),
    externalId: 'GR-001',
    lines: [
        new LineData(
            itemId: $itemId,
            uomId: $uomId,
            warehouseId: $warehouseId,
            qty: 10,
            unitCost: 5000,
        ),
    ],
));

additionalJournalLines: [
    ['mapping_key' => 'purchase_credit_ap_k', 'amount' => 50000],
],
bash
php artisan config:clear
php artisan vendor:publish --tag=inventory-wms-config
php artisan migrate
php artisan inventory:modules
bash
composer vendor:publish --tag=inventory-config
php artisan migrate
php artisan inventory:validate-config
bash
php artisan inventory:accounting:validate
bash
php artisan inventory:approval:validate