Aviato / docs
Plugins & 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. Install getaviato/laravel from Packagist:

composer require getaviato/laravel:^0.1
php artisan aviato:install

The source is available in the Laravel SDK repository.

Configure your application

php artisan aviato:install publishes the configuration and downloads the connector binary for your system from its public releases, at the version in aviato.connector.version. Add --no-download when the application connects to a connector that runs elsewhere. Set the project connection values in your deployment environment:

AVIATO_CONTROL_PLANE_URL=https://api.getaviato.com
AVIATO_CONNECTOR_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 connector 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.

Custom summaries and forms

Register an overview in your provider with Aviato::summary($collection, $document). The Aviato\Laravel\UI helpers build the shared document format: UI::document, UI::node, and UI::bind. For an action, pass UI::form($document) as the second argument to ->form($jsonSchema, $uiSchema). See Custom summaries and forms for metric strips, property rows, reusable components, state, and field presets. The dashboard renders native components without an iframe or customer browser code.

Run and test

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

php artisan aviato:serve --dev reloads the plugin's manifest every second, so changes appear without restarting the connector. With --project=<project id>, or AVIATO_PROJECT in .env and no AVIATO_CONNECTOR_TOKEN, it runs your own development environment of the project: approve this computer once in the browser, and no token is needed. Add --tunnel to reach it from MCP clients through a temporary Cloudflare tunnel. Use php artisan aviato:types to generate a class per collection (Orders::COLLECTION, Orders::STATUS) from your database. See Typed plugins and local development.

Aviato::fake() provides handler tests and an in-memory Data API, with the same method names as the TypeScript and Go test kits. The SDK testing guide demonstrates the fake caller and Data API; the SDK README also covers relation discovery and advanced registrations.

Provider integrations

Register a typed StripePlugin with Aviato::use($stripe). It implements the common IntegrationPlugin contract and provides customer, subscription, and invoice widgets. Bind each widget to an ID column on the current record or one related record. Credentials stay in the customer connector's environment, and provider requests run on that connector.

See Stripe widgets for language-specific examples, credential requirements, permissions, and release availability, or start with the Plugins & integrations overview.

For customer support data, Zendesk widgets provide a typed ZendeskPlugin with user profiles, requested-ticket lists, and individual tickets. Its OAuth scopes are verified by the customer connector before each data request.

To show an Intercom contact with open conversation and ticket counts, see Intercom widgets and its typed IntercomPlugin. The connector reads the access token from its own environment.

Edit on GitHub

On this page