Skip to main content

Overview

Resources are Spatie Laravel Data resources used by core responses and controllers. Each resource has a contract in Esign\UnleashCommerce\Core\Contracts\Resources, and the core maps those contracts to default implementations via the ResourceManifest.

Replace a core resource

Create a custom resource that implements the same contract. You can extend the core resource and override methods as needed:

Bind the resource in the manifest

Register your replacement in a service provider using the ResourceManifest:

Resolve the active resource class

When you need to nest resources or use them inside other resources, resolve the active implementation via resourceClass() so replacements are respected:

Available core resources

See the Resources Reference for a complete list of available resources you can replace.