Skip to main content

Overview

Unleash Commerce Core is built with extensibility in mind. You can customize nearly every aspect of the core functionality without modifying the package itself.

Extension Points

The core package provides several ways to extend functionality:

1. Contract Binding

Contracts define interfaces for key functionality. You can implement your own versions and bind them in the service container:
// In your service provider
$this->app->bind(
    ProductContract::class,
    CustomProductImplementation::class
);

2. Action Contracts

Actions are the primary way business logic is organized. Each action has a corresponding contract that you can create a custom implementation for.

3. Model Extensions

Extend existing models by creating your own subclasses or using observers for additional behavior.

4. Manifest System

The core uses manifests to manage mappings between contracts and implementations. This allows swapping implementations without changing code.

Best Practices

  • Always implement the contract interface when creating custom implementations
  • Use dependency injection to keep your code loosely coupled
  • Test your extensions thoroughly
  • Use observers for non-intrusive model behavior
Explore the sections below to learn how to create custom actions and models.