Laravel Warehouse Framework

Fund package maintenance!

v0.16.2 2021-03-02 10:37 UTC


PHP version Latest Version on Packagist Software License Tests Code style Total Downloads


You can install the package via composer:

composer require mvdnbrk/warehouse-framework

Run the install command:

php artisan warehouse:install

This package uses it's own database.
By default we assume that you will prepare a connection called "warehouse" in your config/database.php file.
If you would like to use a different connection you can do so by setting WAREHOUSE_DB_CONNECTION in your .env file.

Now you can run the migrations for this package with:

php artisan warehouse:migrate



You can retrieve all locations using the Just\Warehouse\Models\Location model:


Create a location with this artisan command:

php artisan warehouse:make:location


Add inventory to a location with a GTIN value, you may pass an amount as the second parameter:

$location = Location::find(1);
$location->addInventory('1234567890005', 2);

Move inventory to another location:

$inventory = Inventory::first();

You may also move inventory with it's GTIN from one location to another:

$location1 = Location::find(1);
$location2 = Location::find(2);

$location1->move('1234567890005', $location2);

Moving many items at once from one location to another:

], $location2);

note: If you are trying to move many items at once and a failure occurs, an exception will be thrown and none of the items will be moved from one location to another.

Remove inventory from a location:

$location = Location::find(1);

Remove all inventory from a location:

$location = Location::find(1);


Create a new order:

$order = Order::create([
    'order_number' => 'my-first-order-0001',

Add order lines with the addLine method by passing a GTIN value, you may pass an amount as the second parameter:

$order->addLine('1234567890005', 2);

note: You can only add order lines when the status of an order is either created or hold.
The same is true if you try to delete an order line.

Process the order:


This will update the order status to open and will be ready to be picked.

Put an order on hold

You can put an order on hold by calling the hold method. Unhold it with the unhold method:


Order status

You can determine the status of an order with the following methods on the status property:


Pick Lists

Once you have created an order you may retrieve a pick list.
To determine if a pick list is available and retrieve it:



The pickList method returns a collection:

$order->pickList()->each(function ($item) {

When the order is picked you can mark it as fulfilled with the markAsFulfilled method:


Replacing an order line

If for some reason a product is missing or for example the items is damaged you may replace an order line with the replace method:


This will delete the reserved product from the inventory and replaces it with another item (if available).


To query stock quantities you may use the \Just\Warehouse\Facades\Stock facade:


For a specific GTIN:



This packages fires several events:

  • InventoryCreated
  • OrderLineCreated
  • OrderLineReplaced
  • OrderStatusUpdated
  • OrderFulfilled


composer test


Please see CHANGELOG for more information what has changed recently.


Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.



The MIT License (MIT). Please see License File for more information.