PHPackages                             a2-atu/a2commerce - 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. [Framework](/categories/framework)
4. /
5. a2-atu/a2commerce

ActiveLibrary[Framework](/categories/framework)

a2-atu/a2commerce
=================

A2 Commerce - A2 is a platform for managing your business. A2 Commerce is a package for Laravel that provides helpful tools for your e-commerce website.

v0.2.1(1mo ago)0963MITPHPPHP ^8.2

Since Dec 15Pushed 1mo agoCompare

[ Source](https://github.com/a2-atu/a2commerce)[ Packagist](https://packagist.org/packages/a2-atu/a2commerce)[ RSS](/packages/a2-atu-a2commerce/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (10)Versions (9)Used By (3)

A2 Commerce
===========

[](#a2-commerce)

Laravel package (**`a2-atu/a2commerce`**) for a decoupled, event-driven e-commerce core: cart, checkout helpers, PayPal, guest checkout, wishlist, and comparison—aligned with **[Vormia](https://github.com/vormiaphp/vormia)** (package-first models/traits) and **Livewire 4**.

**Versioning:** Release lines are tagged in Git. At runtime, `A2\A2Commerce\Support\PackageInfo::version()` (and the container binding `a2commerce.version`) resolve the installed version via [Composer’s InstalledVersions API](https://getcomposer.org/doc/07-runtime.md#installed-versions-api)—no duplicated constant in source.

Breaking change (current major)
-------------------------------

[](#breaking-change-current-major)

This line is **package-first only**: the installer **does not** edit `routes/api.php`, **does not** remove stub-copied `app/` trees, and **does not** delete legacy migration PHP files from the host `database/migrations` folder. If you still have artifacts from an old copy-based workflow, remove or migrate them manually before upgrading, or stay on the previous major.

How this package is structured
------------------------------

[](#how-this-package-is-structured)

- **Runtime code** lives in **`A2\A2Commerce\...`** and is autoloaded from **vendor** (like Vormia’s `Vormia\Vormia\...`). It is **not** copied into `app/Models`, `app/Services`, etc.
- **Migrations** ship with the package and load via `A2CommerceServiceProvider` (`php artisan migrate` in the host app).
- **Config** is merged as `config('a2_commerce.*')`. Optionally publish:
    `php artisan vendor:publish --tag=a2commerce-config`
- **Events / listeners** are registered by **`A2\A2Commerce\Providers\A2CommerceEventServiceProvider`** (no need to duplicate the full map in `AppServiceProvider` unless you add extra listeners).
- **PayPal webhook** is registered by the package:
    **`POST /api/a2/payment/paypal/webhook`**
    Route name: **`api.payment.paypal.webhook`**
    Controller: **`A2\A2Commerce\Http\Controllers\A2\Commerce\PaymentController`**
- **Payment confirmation emails** are **plain text** mailables in the package (`A2\A2Commerce\Mail\...`); no Blade views in the package for those.
- **Storefront UI** (Livewire Volt/Blade routes, buyer middleware, marketing pages) remains in the **host application**; this package provides domain services, models, jobs, and HTTP entrypoints you route to.

For end-to-end storefront patterns, see **[docs/packageflow-md/0-a\_2\_commerce\_implementation\_guide.md](docs/packageflow-md/0-a_2_commerce_implementation_guide.md)**. For assistants and architecture entry points, see **[docs/guide.md](docs/guide.md)**.

Requirements
------------

[](#requirements)

- **PHP** 8.2+
- **Laravel** 12.x or 13.x (`illuminate/*` aligned with [Vormia’s constraints](https://packagist.org/packages/vormiaphp/vormia))
- **vormiaphp/vormia** `^5.4` (taxonomy, slugs, user meta; configure `vormia.user_model` if needed)
- **livewire/livewire** `^4.0` (required by this package’s `composer.json`; Volt storefront is optional in the host app)
- **PayPal** developer account for sandbox/live keys

Installation
------------

[](#installation)

### 1. Require packages

[](#1-require-packages)

```
composer require vormiaphp/vormia
composer require a2-atu/a2commerce
```

Follow [Vormia’s installation docs](https://github.com/vormiaphp/vormia) for auth, migrations, and `User` model traits.

### 2. Run the installer (housekeeping)

[](#2-run-the-installer-housekeeping)

```
php artisan a2commerce:install
```

This **does not** copy models/services into `app/`. It:

- Appends any **missing A2-related `.env` / `.env.example` keys** (unless `--skip-env`)
- Optionally runs **`php artisan migrate`** when you confirm at the prompt

**Options**

- `--skip-env` — do not append A2 keys via the installer’s env helper (you can still edit `.env` yourself)

### 3. Environment

[](#3-environment)

Set PayPal and commerce variables (see also `php artisan a2commerce:help`):

```
A2_PAYPAL_MODE=sandbox
A2_PAYPAL_CLIENT_ID=
A2_PAYPAL_SECRET=
A2_PAYPAL_WEBHOOK_ID=
A2_ORDER_PREFIX=SP-OD
A2_TAX_RATE=0
A2_SHIPPING_FEE=0
A2_CURRENCY=USD
A2_CURRENCY_SYMBOL=$
A2_CURRENCY_CONVERSION_RATE=130
ADMIN_EMAIL=orders@example.com
```

### 4. Migrate

[](#4-migrate)

```
php artisan migrate
```

### 5. Host app wiring

[](#5-host-app-wiring)

- Define **storefront** routes (cart, checkout, PayPal UI) and point actions at **`A2\A2Commerce\Http\Controllers\A2\Commerce\PaymentController`** where appropriate (`initPayPal`, `confirmPayPal`, `success`, `failed`, etc.).
- Resolve services with their **package** FQCNs, e.g.
    `app(\A2\A2Commerce\Services\A2\Commerce\CartService::class)`
- Dispatch **package** events, e.g.
    `A2\A2Commerce\Events\A2\Commerce\CartUpdated`
    (do not rely on old `App\Events\A2\Commerce\...` copies after migrating off legacy installs.)

### Optional: publish config

[](#optional-publish-config)

```
php artisan vendor:publish --tag=a2commerce-config
```

Usage (concepts)
----------------

[](#usage-concepts)

### Services (package)

[](#services-package)

ClassRole`A2\A2Commerce\Services\A2\Commerce\CartService`Cart session, guest + auth`A2\A2Commerce\Services\A2\Commerce\OrderService`Orders from cart`A2\A2Commerce\Services\A2\Commerce\PaymentService` / `PayPalPaymentService`Payments`A2\A2Commerce\Services\A2\Commerce\WishlistService`Wishlist`A2\A2Commerce\Services\A2\Commerce\ComparisonService`Comparison### Events (package)

[](#events-package)

Examples: `CartUpdated`, `OrderCreated`, `PaymentCompleted`, `PaymentFailed`, wishlist/comparison events. Listeners run from **`A2CommerceEventServiceProvider`**.

### PayPal

[](#paypal)

1. Create order (host checkout + `OrderService`).
2. Client uses PayPal JS; server confirms via package services.
3. Webhook hits **`/api/a2/payment/paypal/webhook`** for reconciliation.

Artisan commands
----------------

[](#artisan-commands)

CommandPurpose`php artisan a2commerce:install`Append missing A2 env keys; optional migrate; reminds about publish`php artisan a2commerce:update`Append missing A2 env keys (unless `--skip-env`); cache clear`php artisan a2commerce:uninstall`Optional env strip; optional DB teardown (**MySQL/MariaDB**: drops `a2_ec_*` and prunes package rows from `migrations` when you confirm; other drivers: drop tables manually). Does **not** remove `vendor``php artisan a2commerce:help`Env keys, webhook URL, command summaryDevelopment (this repo)
-----------------------

[](#development-this-repo)

```
composer install
vendor/bin/phpunit
```

Tests use **Orchestra Testbench** and register **Vormia** + **A2Commerce** providers (see `tests/TestCase.php`).

Documentation
-------------

[](#documentation)

Long-form guides live under **`docs/`** (single copy; there is no duplicate `packageflow-md/` at the repository root).

DocContent[docs/guide.md](docs/guide.md)AI / contributor entry: package boundaries, boot path, truth sources[docs/packageflow-md/0-a\_2\_commerce\_implementation\_guide.md](docs/packageflow-md/0-a_2_commerce_implementation_guide.md)Host app integration, routes, Volt examples[docs/packageflow-md/1-a\_2\_commerce\_schema.md](docs/packageflow-md/1-a_2_commerce_schema.md)Tables and relationships[docs/packageflow-md/2-a\_2\_event\_flow.md](docs/packageflow-md/2-a_2_event_flow.md)Event flows[docs/packageflow-md/3-a\_2\_payment\_guide.md](docs/packageflow-md/3-a_2_payment_guide.md)Payment pipeline and webhooks[docs/packageflow-md/4-a\_2\_commerce\_fixes\_plan.md](docs/packageflow-md/4-a_2_commerce_fixes_plan.md)Planning / history notes[docs/packageflow-md/5-a\_2\_commerce\_admin\_order\_review\_shipping.md](docs/packageflow-md/5-a_2_commerce_admin_order_review_shipping.md), [docs/packageflow-md/6-a\_2\_commerce\_admin\_order\_review\_shipping-guide-2.md](docs/packageflow-md/6-a_2_commerce_admin_order_review_shipping-guide-2.md)Admin order / shipping notesTroubleshooting
---------------

[](#troubleshooting)

IssueWhat to checkWebhook not hitPayPal dashboard URL must be **`{APP_URL}/api/a2/payment/paypal/webhook`**; route is on **`api`** middlewareWrong user model on relations`config('vormia.user_model')` and `config('auth.providers.users.model')`Events not firingDispatch **`A2\A2Commerce\Events\...`** classes; ensure `A2CommerceServiceProvider` is registered“Class not found” for servicesUse **`A2\A2Commerce\Services\A2\Commerce\...`** — not `App\Services\A2\...`Links
-----

[](#links)

- [Laravel application structure](https://laravel.com/docs)
- [Laravel Mail](https://laravel.com/docs/mail) (mailable `Content` / `textString`)
- [Vormia](https://github.com/vormiaphp/vormia)
- [Livewire](https://livewire.laravel.com/docs)

---

**Thank you for using A2Commerce.**

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance91

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~37 days

Total

8

Last Release

42d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f69b40bdd7f381ee33360299b1d574f9d9d0af369f7e3d925f7ac2e5d70403aa?d=identicon)[joshlminga](/maintainers/joshlminga)

---

Top Contributors

[![joshlminga](https://avatars.githubusercontent.com/u/7943555?v=4)](https://github.com/joshlminga "joshlminga (41 commits)")

---

Tags

phplaravelcommercevormiaa2commercea2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/a2-atu-a2commerce/health.svg)

```
[![Health](https://phpackages.com/badges/a2-atu-a2commerce/health.svg)](https://phpackages.com/packages/a2-atu-a2commerce)
```

###  Alternatives

[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[raugadh/fila-starter

Laravel Filament Starter.

625.1k](/packages/raugadh-fila-starter)

PHPackages © 2026

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