Skip to main content
A Resource is the core building block of Exo. One Resource definition drives your API shape, trigger events, and webhook payload data.

How resources work

When your Laravel app boots, Exo scans the configured resources directory and registers every Resource class it finds. For each Resource, Exo:
  1. Creates API endpoints under /exo-api/resources/{name} for listing, creating, updating, and deleting records
  2. Attaches model observers that emit on_create, on_update, and on_delete
  3. Makes the resource available for webhook subscriptions

Required methods

Every Resource must extend Exowizz\Exo\Resource and implement four methods:

Optional methods by level

Start with the required four methods. Add optional methods as your integration grows:

Trigger values

The built-in observer emits only these trigger names:
  • on_create
  • on_update
  • on_delete

Creating resources

The fastest way to create a resource is with the Artisan command:
This generates a file at app/Exo/Resources/ContactResource.php with all methods stubbed out. You can also run the command without arguments for an interactive experience:
Exo auto-discovers resources from config('exo.resources_path') (default: app/Exo/Resources) using config('exo.resources_namespace') (default: App\\Exo\\Resources\\).