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:
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_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\\).