A Resource is the core building block of Exo. One Resource definition drives your API shape, trigger events, and webhook payload data.Documentation Index
Fetch the complete documentation index at: https://docs.exowizz.com/llms.txt
Use this file to discover all available pages before exploring further.
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:- Creates API endpoints under
/exo-api/resources/{name}for listing, creating, updating, and deleting records - Attaches model observers that emit
on_create,on_update, andon_delete - Makes the resource available for webhook subscriptions
Required methods
Every Resource must extendExowizz\Exo\Resource and implement four methods:
| Method | What it does |
|---|---|
name() | A unique identifier used in API URLs, e.g. /exo-api/resources/contact |
model() | The fully-qualified Eloquent model class to expose |
triggers() | Which events fire webhooks: on_create, on_update, on_delete |
transform() | Converts a model instance into the array returned by the API |
Optional methods by level
Start with the required four methods. Add optional methods as your integration grows:| Method | Purpose | Default |
|---|---|---|
createRules() | Validation rules for create requests | [] |
updateRules() | Validation rules for update requests | [] |
supportsCreate() | Whether creation is allowed | true |
supportsUpdate() | Whether updates are allowed | true |
supportsDelete() | Whether deletion is allowed | true |
ownerColumn() | Scope records to a user | null (admin-only) |
ownerIsRelationship() | Whether the owner column is a relationship | false |
searchableColumns() | Columns searchable via ?search= | [] (disabled) |
applySearch() | Custom search query logic | OR LIKE on searchableColumns |
baseQuery() | Starting query (add scopes, eager loads) | Model::query() |
performCreate() | Custom create logic | Model::create() |
performUpdate() | Custom update logic | $model->update() |
webhookQueue() | Queue name for this resource’s webhooks | config('exo.queue') |
webhookMaxAttempts() | Override delivery attempt limit for this resource | null |
webhookBackoff() | Override delivery backoff schedule for this resource | null |
recordAllEvents() | Persist events even without matching subscriptions | false |
isAdmin() | Whether the current user is an admin | Uses config('exo.is_admin') |
Trigger values
The built-in observer emits only these trigger names:on_createon_updateon_delete
Creating resources
The fastest way to create a resource is with the Artisan command: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\\).