Skip to main content

Prerequisites

  • PHP 8.3+
  • Laravel 12
  • Laravel Passport 13 (installed and configured)
  • A queue worker running (for webhook delivery)

Installation

1

Install the package

composer require exowizz/exo
2

Publish the configuration

php artisan vendor:publish --tag=exo-config
This creates config/exo.php where you can customize route prefixes, middleware, and other settings.
3

Run migrations

php artisan migrate
Exo creates the exo_webhook_subscriptions table for storing webhook subscriptions.
4

Create a user with an API token

php artisan exo:user
Follow the prompts to enter a name, email, and password. Exo will create the user and generate a Personal Access Token. Copy this token — you’ll use it to authenticate API requests.
The token is only shown once. Store it somewhere safe.

Create your first resource

A resource tells Exo which Eloquent model to expose and how. Let’s expose a Contact model.
1

Generate the resource class

php artisan exo:resource ContactResource --model="App\Models\Contact" --triggers=on_create,on_update,on_delete
This creates app/Exo/Resources/ContactResource.php.
2

Customize the transform

Open the generated file and update the transform method to control which fields are returned:
public function transform(Model $model): array
{
    return [
        'id' => $model->id,
        'name' => $model->name,
        'email' => $model->email,
        'phone' => $model->phone,
        'created_at' => $model->created_at,
    ];
}

Test the API

Use the token from the exo:user command to make your first API call:
curl -H "Authorization: Bearer YOUR_TOKEN" \
     http://your-app.test/exo-api/resources
You should see your contact resource listed:
{
  "data": [
    {
      "name": "contact",
      "model": "App\\Models\\Contact",
      "triggers": ["on_create", "on_update", "on_delete"]
    }
  ]
}
To list contacts:
curl -H "Authorization: Bearer YOUR_TOKEN" \
     http://your-app.test/exo-api/resources/contact

Next steps

Create your first resource

Walk through building a resource step by step.

Set up webhooks

Get notified when your data changes.