Aviato / docs
Build integrations

Laravel SDK

Define Aviato actions and hooks inside your Laravel application.

View Markdown

The Laravel SDK requires PHP 8.3 or newer and Laravel 12 or 13. Its package name is aviato/laravel; use a published release compatible with your agent. The implementation lives in packages/sdk-laravel.

Configure your application

With the package installed, php artisan aviato:install publishes its configuration and downloads the agent binary. Set the project connection values in your deployment environment:

AVIATO_CONTROL_PLANE_URL=https://api.getaviato.com
AVIATO_AGENT_TOKEN=replace-with-your-project-token
AVIATO_PLUGIN_SECRET=replace-with-your-standard-webhooks-secret
AVIATO_PLUGIN_URL=https://your-app.example.com/aviato

The database URL defaults to your Laravel database connection. Override it with AVIATO_DATABASE_URL when the agent should use a different database account.

Register an action

Register definitions from a service provider's boot method:

use Aviato\Laravel\Context\ActionContext;
use Aviato\Laravel\Facades\Aviato;

Aviato::action('customers', 'Confirm selection')
    ->single()
    ->execute(function (ActionContext $context) {
        $customer = $context->records()[0];
        return $context->success('Customer selected');
    });

Plugin endpoints are outside Laravel's browser-session middleware. Requests are authenticated using their signatures, not a session cookie or CSRF token.

Run and test

php artisan aviato:serve runs the downloaded agent with your configured connection and plugin settings. Use a process supervisor and durable agent data directory in production.

Aviato::fake() provides handler tests and an in-memory Data API. The Laravel fixture shows a working application; the SDK README covers testing, relation discovery, and advanced registrations.

Edit on GitHub

On this page