PHPackages                             bjerke/laravel-headless-ecommerce - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. bjerke/laravel-headless-ecommerce

ActiveLibrary[API Development](/categories/api)

bjerke/laravel-headless-ecommerce
=================================

A headless ecommerce package for Laravel

761PHP

Since Mar 7Pushed 5y ago2 watchersCompare

[ Source](https://github.com/jesperbjerke/laravel-headless-ecommerce)[ Packagist](https://packagist.org/packages/bjerke/laravel-headless-ecommerce)[ RSS](/packages/bjerke-laravel-headless-ecommerce/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Headless Ecommerce
==========================

[](#laravel-headless-ecommerce)

A headless ecommerce package for Laravel.

### Installation:

[](#installation)

```
composer require bjerke/laravel-headless-ecommerce
```

Publish and run migrations:

```
php artisan vendor:publish --tag="ecommerce.migrations"
php artisan migrate
```

If you want to change the default configuration:

```
php artisan vendor:publish --tag="ecommerce.config"
```

If you want to change the included lang files:

```
php artisan vendor:publish --tag="ecommerce.lang"
```

### Extending functionality of models

[](#extending-functionality-of-models)

All models used by this package can be overridden with your own versions. Just extend the original ones and configure your model class in the config file.

### Product

[](#product)

```
- Product types
- Laravel Scout
    - Searching, default driver, disabling (driver = null)
- Laravel Media Library
    - Images
    - Files
- Laravel Translatable
- Laravel Sluggable

```

### Variations

[](#variations)

```
- Variation syncing

```

### Prices

[](#prices)

```
- MoneyPHP
- VAT
- Optinally sync prices against exchange rate by running the SynPrices job on schedule (otherwise it will only update if the base price changes)

```

### Deals

[](#deals)

### Stock

[](#stock)

```
- Multiple stock types / stores (web, shops etc)
- Current stock / Incoming stock / Outgoing stock
- Low stock event
- Optional schedule to remove old stock logs

```

### Categories

[](#categories)

```
- Laravel Nested Set

```

### Properties

[](#properties)

### Stores

[](#stores)

### Brands

[](#brands)

### Cart

[](#cart)

```
- Optional schedule to keep track of expired carts
- Optional schedule to remove expired carts

```

### Orders

[](#orders)

### Order logs

[](#order-logs)

```
- Optional schedule to remove old order logs
- Optional schedule to remove old payment logs

```

### Shipping

[](#shipping)

### Payments

[](#payments)

```
- Omnipay

```

### Translations

[](#translations)

```
- Laravel Translatable

```

### Commands

[](#commands)

These are commands that you can optionally add to your schedule to have some things run automatically.

- `ecommerce:clean-abandoned-carts` - Checks for expired carts and deletes them (suggested to run daily)
- `ecommerce:check-expiring-carts` - Triggers expiring cart event (suggested to run daily)
- `ecommerce:clean-order-logs` - Deletes order logs older than the config `ecommerce.orders.log_ttl` (suggested to run daily)
- `ecommerce:clean-stock-logs` - Deletes stock logs older than the config `ecommerce.stock.log_ttl` (suggested to run daily)
- `ecommerce:clean-payment-logs` - Deletes payment logs older than the config `ecommerce.payment.log_ttl` (suggested to run daily)

### Events

[](#events)

- CartExpiring
    - This event will fire when a cart is about to expire (if a schedule for `ecommerce:check-expiring-carts` is setup). This can be useful for sending notifications to the customer to come back and finish their purchase.
    - Keep in mind that these can be triggered multiple times for the same cart. If you are sending a notification, you probably need to check if you've already sent this notification so you don't spam your customers.
- LowStock
    - This will fire when the low stock threshold is reached after updating stock.
    - Keep in mind that these can be triggered multiple times for the same cart. You probable need to keep track if you have already acted on this event before.

### Routes

[](#routes)

To see all registered routes run:

```
php artisan route:list
```

You can override routes in two different ways. First way is to write your own controller, extending the original one, then configure that controller in the config file (similar to the config for models). The second way is to publish the route file.

```
php artisan vendor:publish --tag="ecommerce.routes"
```

This will completely decouple the routefile within the package. Now you are free to change whatever you like. Keep in mind though that possible future updates to the route file will have to be migrated manually to your custom file.

There are also some configuration options regarding routing, such as prefix to use, default global middleware and which authentication middleware to use. You can look more closely in the config file of this package so see what you can change.

### Authentication &amp; Authorization

[](#authentication--authorization)

Default authentication middleware to require logged in user is `auth:api`. You can configure this in the config file.

We are also using the `can` middleware, to prohibit unauthorized access to non-public endpoints. You can use packages like Bouncer or Spatie Laravel Permission to handle abilities, or define your own Gates &amp; Policies.

#### Abilities used:

[](#abilities-used)

- manage-products
- manage-brands
- manage-categories
- manage-deals
- manage-prices
- manage-orders
- manage-prices
- manage-properties
- manage-shipping-methods
- manage-stocks
- manage-stores

### Customers / Users

[](#customers--users)

This package does not provide any logic for handling customers or logged in users. This is up to the implementing application to add. As an example, you might want to add a user\_id column to the orders table to be able to link it to a user account. Just change the migration after publishing and then extend the appropriate models/observers/controllers to handle this new column.

### Disabling scout

[](#disabling-scout)

You can disable the automatic Scout integration by defining the following in your .env file

```
ECOMMERCE_USE_SCOUT=false
SCOUT_DRIVER=null
```

### Requirements

[](#requirements)

- PHP 7.4+
- Taggable cache store (like redis, memchached etc)
- SQL Database that supports JSON column type
- Intl extension
- A queue worker running

### Packages used

[](#packages-used)

- [Laravel BREAD](https://github.com/jesperbjerke/laravel-bread)
- [Laravel API Query Builder](https://github.com/jesperbjerke/laravel-api-query-builder)
- [Laravel Scout](https://github.com/laravel/scout)
- [MoneyPHP](https://github.com/moneyphp/money)
- [Spatie Laravel Media library](https://github.com/spatie/laravel-medialibrary)
- [Spatie Laravel Sluggable](https://github.com/spatie/laravel-sluggable)
- [Spatie Laravel Translatable](https://github.com/spatie/laravel-translatable)
- [Laravel NestedSet](https://github.com/lazychaser/laravel-nestedset)
- [Omnipay](https://github.com/thephpleague/omnipay)

### Ideas for improvement

[](#ideas-for-improvement)

*Points marked with (?) are unsure if relevant to this package scope*

- Deals
    - Discount code
    - Gift cards
    - Bundles (?)
- More product types:
    - Digital content
    - Subscription
    - Preorders
    - Configurable products
- More media types
    - Video (?)
- On demand stock
- Optionally reserve stock upon adding to cart
- Wishlists (?)
- Favorites (?)
- Reviews/Rating (?)
- Cart
    - Optionally reserve stock upon adding to cart
- More alternatives to shipping pricing
    - Dynamic (calculated based on ordered products)
    - Tiers?
    - Free shipping above X order value?
- Product upsell, cross-sell
- Suppliers
    - Procurements
- PoS features (?)
- Prisjakt/Pricerunner integration - Separate package
- Facebook / Instagram shopping (?) - Separate package
- Google Shopping (?) - Separate package
- Webhooks (?)
- Statistics (?)
- Import / Export products (?)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1756908bb0103b783e0cb8fec49678e73ad98ff698a7889b783f10dbc2e0b988?d=identicon)[jesperbjerke](/maintainers/jesperbjerke)

---

Top Contributors

[![jesperbjerke](https://avatars.githubusercontent.com/u/5323483?v=4)](https://github.com/jesperbjerke "jesperbjerke (16 commits)")

### Embed Badge

![Health badge](/badges/bjerke-laravel-headless-ecommerce/health.svg)

```
[![Health](https://phpackages.com/badges/bjerke-laravel-headless-ecommerce/health.svg)](https://phpackages.com/packages/bjerke-laravel-headless-ecommerce)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
