Locations represent physical places where you store inventory and ship orders from: warehouses, retail stores, fulfillment centers, or even your apartment. Each location has its own address and can track stock independently, so a product can have 50 units in your Paris warehouse and 20 in your New York store. When Shopper is first installed, the setup wizard creates a default location using your store’s address. All stock mutations target this location unless you specify another one. If your business ships from multiple places, you can add more locations and assign stock to each one.Documentation Index
Fetch the complete documentation index at: https://docs.laravelshopper.dev/llms.txt
Use this file to discover all available pages before exploring further.
Model
The model used isShopper\Core\Models\Inventory. It implements Shopper\Core\Models\Contracts\Inventory and is configurable via config/shopper/models.php.
Extending the Model
To add custom behavior, extend the model and update your configuration:config/shopper/models.php:
Database Schema
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | no | auto | Primary key |
name | string | no | - | Location name |
code | string | no | - | Unique identifier code |
description | text | yes | null | Location description |
email | string | no | - | Location contact email (unique) |
street_address | string | no | - | Street address |
street_address_plus | string | yes | null | Additional address line |
postal_code | string | no | - | Postal/ZIP code |
city | string | no | - | City |
state | string | yes | null | State/province/region |
phone_number | string | yes | null | Phone number |
priority | integer | no | 0 | Fulfillment priority order |
latitude | decimal(11,5) | yes | null | GPS latitude |
longitude | decimal(10,5) | yes | null | GPS longitude |
is_default | boolean | no | false | Default location for stock |
country_id | bigint | no | - | FK to countries table |
created_at | timestamp | yes | null | Creation timestamp |
updated_at | timestamp | yes | null | Last update timestamp |
Relationships
Country
Each location belongs to a country:Inventory Histories
Every stock mutation (increase, decrease, set) on any product or variant creates anInventoryHistory record tied to a specific location. This is how Shopper tracks stock per location.
Query Scopes
Thedefault scope returns the location marked as the default inventory. This is the location used by InitialQuantityInventory when setting stock during product creation.
How Locations Connect to Stock
When you callmutateStock(), decreaseStock(), or setStock() on a product or variant, you pass an $inventoryId. This ties the stock mutation to a specific location:
Creating Locations
To create a new warehouse location:Retrieving Locations
To get the default location:Default Location
The default location is used as the origin address for shipping calculations and as the fallback when stock operations do not specify a location. Only one location can be the default.Components
To customize the admin UI for location management:config/shopper/components/setting.php: