Search by

arzcode / infinito-onboarding

arzcode

Announce what's new in your Filament panel with DB-managed, visually authored guided tours.

Package info

github.com/buzkall/infinito-onboarding

pkg:composer/arzcode/infinito-onboarding

Fund package maintenance!

buzkall

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.2.0 2026-12-01 19:45 UTC

This package is auto-updated.

Last update: 2026-12-01 19:46:13 UTC


README

Announce what's new in your Filament panel with DB-managed, visually authored guided tours.

Infinito Onboarding shows your existing users what changed: a guided tour that highlights the new button, or a changelog modal that lists the release notes. Tours live in the database, are versioned, are shown once per user per version, and can be authored by clicking on the page (record mode) instead of hand-writing CSS selectors.

It is built on Driver.js (bundled, no CDN) and targets Filament 5, Laravel 12+, Livewire 4, PHP 8.3+.

A guided tour step highlighting the Export orders action in a Filament panel

How is this different from an onboarding tour?

Classic onboarding tours run once for new users, live in code, and break the moment a class name changes. Infinito Onboarding is made for the what's new problem:

Classic onboarding Infinito Onboarding
Audience New users Existing users, per feature release
Stored in Code Database (with a code-first builder and JSON export for git)
Shown Once Once per version: bump the version and everyone sees it again
Targeting CSS selectors ->tourTarget('key') on the Filament component, then id, wire:key, generated path
Authoring By hand Record mode: click the element, write the copy, save
Modes Tour Tour, hints (persistent beacons) and changelog modal with a "What's new" topbar button

Installation

composer require arzcode/infinito-onboarding
php artisan infinito-onboarding:install

The installer publishes the migrations, offers to publish the config and run the migrations, publishes the Filament assets and registers the plugin in the app/Providers/Filament/*PanelProvider.php files you pick (asking whether to add the resource and the "What's new" button). It adds ->authorize(fn (): bool => app()->isLocal()) as a placeholder: replace it with your own check, otherwise nobody can manage, preview or record tours outside local environments.

Re-running the installer is safe: migrations are not published twice, an existing config is kept, and panels that already mention InfinitoOnboardingPlugin are left as they are. Every patched provider is checked to still be valid PHP before it is written; when a provider can't be patched safely, the installer tells you to register the plugin by hand.

Manual installation

php artisan vendor:publish --tag="infinito-onboarding-migrations"
php artisan migrate
php artisan filament:assets

Optionally publish the config (table names, query flags, export path) and translations:

php artisan vendor:publish --tag="infinito-onboarding-config"
php artisan vendor:publish --tag="infinito-onboarding-translations"

Register the plugin in your panel provider:

use Arzcode\InfinitoOnboarding\InfinitoOnboardingPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(
            InfinitoOnboardingPlugin::make()
                ->resource()                                   // manage tours from the panel (opt-in)
                ->topbarTrigger()                              // "What's new" button with unseen badge (opt-in)
                ->authorize(fn (User $user) => $user->isAdmin()) // who may manage, preview and record tours
                ->enabled(fn () => ! app()->runningUnitTests()),
        );
}

Everything is opt-in: with only ->plugin(InfinitoOnboardingPlugin::make()) the overlay runs and nothing else is registered.

Uninstalling

php artisan infinito-onboarding:uninstall

Removes the plugin from your panel providers and deletes the published assets without asking. It then asks separately before dropping the onboarding tables, deleting the published migrations, config, translations and views, and running composer remove arzcode/infinito-onboarding --no-update-with-dependencies.

Only this package is touched: other plugins in the same ->plugins([...]) array, other packages' assets, migrations and translations are left alone. The --no-update-with-dependencies flag stops Composer from upgrading shared dependencies such as Filament while removing the package. A provider that can't be unpatched safely (a subclass of the plugin, for instance) is not modified, and you're told to edit it by hand.

Plugin options

Option Default What it does
enabled(bool|Closure) true Switch the whole overlay on or off.
authorize(Closure) nobody Receives the user. Gates the resource, ?onboarding-preview and record mode.
resource(bool|Closure, ?string $class) false Registers TourResource (pass a subclass to customise it).
navigationGroup() / navigationSort() null Placement of the resource in the sidebar.
topbarTrigger(bool|Closure, string $hook) false Renders the "What's new" changelog button (hook defaults to GLOBAL_SEARCH_AFTER).
recorderLocale(Closure) the default locale The locale record mode shows its interface and edits the steps in. Receives $user. Without it, the interface follows the page.
pageUrl(Closure) the current host Builds the URL Preview and Record steps open, when tours run on another host (see Tours on another host).
segment(string, array|Closure) / segments(array) none Registers reusable audiences (see Segments).
tenant(?Closure, bool $scopeAuthoring = true) Filament's tenant Resolves the tenant id in apps without Filament tenancy. scopeAuthoring: false keeps authoring central (see Multi-tenancy).
tenantOptions(Closure) / tenantGroups(Closure) none Tenants and groups of tenants a tour can be targeted at.

Screenshots

Guided tour (dark mode) Hint mode (beacons)
Guided tour in dark mode Pulsing beacon opened next to the Bulk actions button
Record mode: pick an element Record mode: write the step
Hovering a form field in record mode shows the selector it would capture The floating editor with target, title, body, preconditions and placement
Changelog modal "What's new" topbar button
Release notes modal The topbar trigger re-opening the latest changelogs
Tour resource Analytics on the edit page
The Tours resource table Views, completion rate, per-step drop-off and missing targets

Targeting: ->tourTarget() is the recommended approach

Filament's .fi-* classes change between releases; Livewire re-renders the DOM. A tour that depends on generated selectors breaks silently. The package therefore adds a tourTarget() macro to Filament components which stamps a stable data-tour="key" attribute on the element a step should highlight.

Before (fragile):

// Step target: ".fi-ta-header-toolbar .fi-btn:nth-child(2)"
Action::make('export');

After (stable):

Action::make('export')->tourTarget('export-orders');
// Step target: export-orders  →  [data-tour="export-orders"]

It works on actions, form fields (the whole field wrapper, label included), infolist entries, table columns (the header cell, once per column), navigation items and layout components such as sections:

TextInput::make('email')->tourTarget('email-field');
TextColumn::make('status')->tourTarget('status-column');
Section::make('Billing')->tourTarget('billing-section');
NavigationItem::make('Orders')->tourTarget('nav-orders');

Anything else can be targeted with a raw CSS selector (target_type = css), and a step with target_type = none is shown centred with no highlight.

Authoring tours

1. From the panel (TourResource)

Enable ->resource() and you get a Tours resource: name, key, mode, route pattern (with your panel's routes as suggestions), version, publish toggle, start/end window, audience (roles, permissions), sort, active flag, and a Steps relation manager with drag-and-drop ordering, target type/target, rich-text body and placement.

Table actions:

  • Preview: opens the tour's route with ?onboarding-preview=<key>, which forces the tour for you regardless of seen-state (and never records a completion).
  • Reset seen-state: deletes the tour's completions so every user sees it again.
  • Record steps (also on the edit page and the Steps table): opens record mode on the tour's page. If the route pattern matches several pages (admin/orders/*/edit, or a list of patterns), it asks which page to record on.

The list page also has Record a tour: enter a name, key and page, and it creates an unpublished draft and opens record mode on it, so you never have to type the ?onboarding-record URL yourself.

2. Record mode (click, don't write selectors)

Visit any panel page as an authorised user with:

https://your-app.test/admin/orders?onboarding-record=orders-q3

If the key is new, an unpublished draft tour scoped to that path is created. A floating panel appears:

  1. Pick element: hover shows a dotted outline and the selector that would be captured; click captures it.
  2. Write the title, body and choose a placement; add the step.
  3. Repeat, drag to reorder, Preview runs the tour immediately, Save persists through Livewire. Esc cancels picking / exits.

You do not need to add ids to your pages: the recorder identifies the element you clicked from what Filament and Livewire already render. Press ↑ while hovering to select the parent element (the whole card instead of its text) and ↓ to go back.

Every captured target is scored:

  • 🟢 green: the element has a data-tour attribute, a stable id, or is a Livewire component such as a widget ([wire:name="App\Filament\Widgets\NextPerformance"]).
  • 🟠 amber: identified by a wire:key, wire:click, link URL or input name, or by a short path (up to 3 levels) inside one of the above, e.g. the second stat card of a stats widget.
  • 🔴 red: a long generated CSS path, or a selector matching more than one element. The panel tells you which Filament component to add ->tourTarget('key') to.

Publish the tour from the resource (or with the builder) when you are happy.

3. Code-first (lives in git)

use Arzcode\InfinitoOnboarding\Models\Tour;

Tour::define('q3-2026')
    ->name('Q3 release')
    ->route('admin/orders*')          // several patterns: ->route('a*', 'b*')
    ->version('2.4.0')
    ->roles(['admin', 'editor'])      // ->permissions(), ->users(), ->tenant()
    ->step('export-orders', 'Export orders', 'You can now export to CSV and XLSX.')
    ->step('status-column', 'Status at a glance', 'Colours follow the order state.', 'bottom')
    ->note('That is it for now', '<p>Thanks for reading.</p>')   // centred step
    ->publish()                       // or ->publish('2026-10-01 09:00')
    ->save();

save() upserts by key and replaces the steps. Run it from a seeder or a deploy hook: running it twice changes nothing, and completions are kept, so bumping version() is what makes the tour appear again.

4. Import / export (promote between environments)

php artisan onboarding:export              # writes database/tours/<key>.json for every tour
php artisan onboarding:export orders-q3    # a single tour
php artisan onboarding:import              # syncs JSON → DB by key, never duplicates
php artisan onboarding:import --fresh      # also deletes tours missing from the directory

The directory comes from config('infinito-onboarding.export_path'); both commands accept --path=. The JSON format has no ids, so a tour recorded on staging can be committed and imported in production.

Hint mode (beacons)

Set mode = hint (or ->hints() on the builder) and, instead of a guided tour, every step's target gets a pulsing dot. Clicking a dot highlights the element with the step's title and body and a Got it button; each dismissed hint disappears and stays dismissed per user and version, and the tour counts as completed once every hint is gone. Hints are persistent: they survive reloads until dismissed, which suits "there is a new button here" announcements that should not interrupt.

Tour::define('new-toolbar')->hints()
    ->step('export-orders', 'Export orders', 'Download CSV or XLSX.')
    ->step('bulk-actions', 'Bulk actions', 'Select rows to see them.')
    ->publish()->save();

The browser event infinito-onboarding:hint-dismissed fires per hint. Steps without a target are ignored in hint mode.

Steps inside modals and tabs (preconditions)

A step can run actions before it is shown, so targets that only exist once a modal or tab is open still work:

Tour::define('settings')
    ->step('open-settings', 'Settings live here')->advanceOnClick()      // clicking the button moves on
    ->step('settings-modal-title', 'Your new settings')
        ->clickFirst('open-settings')                                    // opens the modal first
        ->waitFor('#settings-modal', 5000)                               // then waits for it (optional)
    ->save();
  • clickFirst(), waitFor() and dispatchFirst('event', [...]) apply to the last added step; pass a ->tourTarget() key or a CSS selector.
  • advanceOnClick() lets the user click the highlighted element (a wire:click button, a link) and moves to the next step once Livewire has finished its request.
  • In the resource, the step form has an Open this first repeater and an Advance when the element is clicked toggle. In record mode, the editor offers Pick element to click first.
  • Targets that are still missing after their preconditions are skipped with a console warning, in both directions.

Multi-language content

Set the locales you author in; the first one is the default and is stored in the normal columns, the others in a translations JSON column:

// config/infinito-onboarding.php
'locales' => ['en', 'es'],
'locale_labels' => ['es' => 'Español'],

The tour and step forms then show one tab per locale: the default locale's tab holds the base fields (name, description; step title, body) and every other tab its translation, so one tour serves every language. Record mode edits the default locale, whatever the current one, or the one returned by ->recorderLocale(), e.g. the author's: ->recorderLocale(fn (User $user) => $user->locale). A step recorded in another locale also gets its text in the default one, until you translate it. Fill the other locales from each step's edit form. At runtime the overlay uses the current app locale, then fallback_locale (defaults to the app's), then the default. No translation package is required; the builder and the JSON format carry translations too:

Tour::define('q3')
    ->translateTour('es', ['name' => 'Novedades del Q3'])
    ->step('export-orders', 'Export orders', 'CSV and XLSX.')
        ->translate('es', ['title' => 'Exportar pedidos', 'body' => 'CSV y XLSX.'])
    ->save();

Read content through $step->translated('title') in your own code.

Analytics

Every tour records events (views, highlighted steps, completions, dismissals and target not found skips) per user, tenant and version. The tour's edit page shows a widget with views, unique viewers, completion rate, a per-step reached / drop-off table and the list of missing selectors with how often they failed, so you know which component still needs a ->tourTarget().

  • Disable with 'analytics' => ['enabled' => false] in the config. Preview and record mode never record events.
  • Flood protection: each user can record at most analytics.max_events_per_minute events per tour (default 60, null disables it).
  • Retention: php artisan onboarding:prune-events deletes events older than analytics.prune_after_days (default 90). Schedule it daily.
  • Erasure: php artisan onboarding:forget-user {id} (or app(Support\UserData::class)->forget($id) from your user deletion flow) deletes a user's completions and events. User ids have no foreign key, so deleting a user does not cascade.
  • Query the data yourself through Arzcode\InfinitoOnboarding\Models\TourEvent or Support\TourAnalytics::summary($tour).

Changelog mode

Set mode = changelog (resource) or call ->changelog() on the builder. Instead of Driver.js, the tour renders as a single modal listing its steps as release-note entries (title + body). It uses the same resolver and seen-state, so it also shows once per user per version.

With ->topbarTrigger() a "What's new" icon button appears in the topbar with a dot while an unseen changelog exists. Users can re-open the latest changelogs from it at any time; "Got it" marks them seen.

When does a tour show? (resolver rule)

On every panel page load the package picks the first tour, ordered by sort, where all of the following hold:

  1. is_active
  2. published_at is set and not in the future
  3. now is within starts_at / ends_at (null bounds are open)
  4. the route pattern matches the current path (Str::is, so admin/orders* works; comma-separate several; empty = every page)
  5. the user passes the audience gate (see below)
  6. tenant_id equals the current tenant, or is null and the tour's tenant targets (if any) include the current tenant
  7. there is no completion row for the tour's current version

Nothing at all is rendered when no tour resolves, so pages without a tour carry no extra Livewire component.

Audience

The audience JSON column may contain:

{ "roles": ["admin"], "exclude_roles": ["student"], "permissions": ["export orders"], "users": [1, 2] }

Each present criterion must pass (any of its values). Users with any role in exclude_roles (->exceptRoles() on the builder) never see the tour, even if they also have one of its roles. To show a tour to a single role, roles is enough; use exclude_roles for "everyone except". Roles use hasAnyRole() / hasRole() when your user model provides them (spatie/laravel-permission) and fall back to a roles attribute or relation; permissions go through Laravel's Gate, so plain policies work and nothing breaks when no permission package is installed.

In the resource, roles are free text with suggestions from spatie/laravel-permission. When your roles are a backed enum, point the config at it and the field becomes a select of its cases (labelled through Filament's HasLabel, stored by value):

// config/infinito-onboarding.php
'role_enum' => App\Enums\Role::class,

Segments

Define reusable audiences once and reference them from any tour ("segments": ["beta"], ->segments('beta'), or the Segments select in the resource). A segment is criteria or a closure:

// config/infinito-onboarding.php
'segments' => [
    'admins' => ['roles' => ['admin']],
],

// or in the panel provider
InfinitoOnboardingPlugin::make()
    ->segment('beta', fn (User $user): bool => $user->is_beta)
    ->segment('enterprise', ['permissions' => ['manage billing']]),

The user must belong to at least one of the listed segments; unknown segment names never match.

Multi-tenancy

Completions are stored per tenant (Filament::getTenant()), so a user sees a tour once per tenant. A tour with a tenant_id only shows in that tenant; tours without one show everywhere. User ids are stored as strings, so UUID and integer keys both work.

Inside a tenant, authors only manage that tenant's own tours: the resource lists them, new and edited tours are saved under the current tenant, and record mode refuses keys belonging to another tenant. Tours for every tenant (no tenant_id) are managed from a panel without tenancy, in code (Tour::define()) or through onboarding:import.

A database per tenant

Apps that switch database.default to each tenant's own database during the request (stancl/tenancy, a custom connection switcher) need two settings, so every tenant reads the same tours from the central database while seen-state stays separate per tenant:

// config/infinito-onboarding.php: where the onboarding tables live
'connection' => 'central',

// The panel's plugin: the tenant, when it is not a Filament tenant
InfinitoOnboardingPlugin::make()
    ->tenant(fn () => tenant()?->getTenantKey())

Run the migration once, against that connection. Without ->tenant(), two users with the same id in different tenants would share one seen row.

Targeting tenants from a central tour

When tours are written once and shown in chosen tenants, keep authoring central and give the resource the tenants to pick from, one by one or in groups (by language, plan, region…):

InfinitoOnboardingPlugin::make()
    ->tenant(fn () => tenant()?->getTenantKey(), scopeAuthoring: false)
    ->tenantOptions(fn () => Team::pluck('name', 'id'))
    ->tenantGroups(fn () => [
        'es' => ['label' => 'Spanish', 'tenants' => Team::where('lang', 'es')->pluck('id')],
    ])

The audience section then shows Tenants and Tenant groups selects, stored as audience.tenants and audience.tenant_groups. A tour shows in a tenant that is listed or belongs to a listed group; with neither, it shows everywhere. Group membership is read when the tour resolves, so tenants created later join their group without editing the tour. From code: Tour::define(…)->forTenants(3, 7)->forTenantGroups('es').

scopeAuthoring: false lets an author working inside any tenant see and edit every tour, and saves new tours and record-mode drafts without a tenant_id; seen-state stays per tenant. Without it, authors inside a tenant only manage that tenant's own tours.

Tours on another host

Preview and Record steps open the tour's page on the host you are on. When tours are managed on one host and run on another (a central admin panel, with a panel on each tenant's subdomain), build that URL on the plugin of the panel where you manage them:

InfinitoOnboardingPlugin::make()
    ->resource()
    ->pageUrl(function (string $path, Tour $tour): ?string {
        $domain = Team::first()?->domain;    // the tenant to record on, e.g. https://acme.app.test

        return $domain ? "{$domain}/{$path}" : null;
    })

The closure receives the page path and the tour, and returns the full URL without the preview or record flag; return null for the default. You must be signed in on that host, and pass the authorize() closure of the panel the page belongs to: it receives that panel's user, so if the panels use different guards, allow the right users there too. Otherwise the page opens without the recorder.

The route pattern field suggests the pages of every panel that registers the plugin.

Authorisation

  • The overlay shows to any authenticated panel user that the resolver selects.
  • The resource, ?onboarding-preview and record mode are only available to users passing the plugin's authorize() closure. By default that is nobody.
  • Record mode and preview never persist seen-state.

Replaying a tour

Completing or closing a tour marks it seen, so it does not start again. Users can replay the current page's guided tour from any button of yours that dispatches infinito-onboarding:replay:

@if (\Arzcode\InfinitoOnboarding\Livewire\TourOverlay::replayableTour())
    <button type="button" x-data x-on:click="$dispatch('infinito-onboarding:replay')">
        Repeat the tour
    </button>
@endif

TourOverlay::replayableTour() returns the tour the user could replay on this page (eligible in every way except seen-state; guided tours only, as changelogs reopen from the topbar trigger), so the entry can be hidden on pages without one. Call it while the page renders. A replay records events and seen-state like the first run.

Events (browser)

The overlay dispatches infinito-onboarding:step, infinito-onboarding:completed and infinito-onboarding:dismissed on window (event.detail carries the tour and step payload) so you can hook analytics.

Compatibility

Package Version
PHP 8.3, 8.4, 8.5
Laravel 12, 13
Filament 5.x
Livewire 4.x
Driver.js 1.14 (bundled)

Upgrading

See CHANGELOG.md. Migrations are published, so run php artisan vendor:publish --tag="infinito-onboarding-migrations" again after upgrades that add columns, and php artisan filament:assets after every upgrade.

Troubleshooting: "my step doesn't appear"

  • Unpublished / inactive / out of window: check published_at, is_active, starts_at, ends_at in the resource. Preview with ?onboarding-preview=<key> bypasses seen-state but not the target lookup, so it is the fastest way to check the page itself.
  • Already seen: completions are per user, tenant and version. Bump the version or use Reset seen-state.
  • Route pattern: it is matched against the request path (admin/orders/12/edit), not the route name. Use admin/orders*.
  • Missing target: the browser retries five times (100 → 800 ms) then skips the step and logs target not found … (selector: …) in the console. Add ->tourTarget() to the component or fix the selector. Elements inside closed modals or inactive tabs are not visible: open them first with step preconditions.
  • Livewire morph moved the element: the popover re-anchors on livewire:navigated, morph hooks and resize. If it drifts, make sure the target element keeps a stable data-tour / wire:key so it survives the morph.
  • No assets: run php artisan filament:assets after installing or upgrading.
  • Custom theme: the popover uses Filament's CSS variables (--primary-*, --gray-*). Override .driver-popover.io-popover in your theme if needed.
  • NumberFormatter … is invalid on the tours list: Filament formats the bulk-selection count with the app locale, which fails when the locale is not a valid ICU locale (a custom dialect code). Set 'bulk_actions' => false in config/infinito-onboarding.php to drop bulk delete and row selection from the tours and steps tables.

Testing

composer test          # Pest
composer analyse       # PHPStan (level 10)
composer format        # Pint
composer refactor      # Rector (composer refactor:check for a dry run)
npm run build          # rebuild resources/dist (committed; consumers do not need npm)
npm run test:browser   # optional Playwright smoke tests of the bundle (see tests/browser)

Stability guarantees

The package follows semantic versioning. Until v1.0.0, a minor release (0.1 → 0.2) may contain breaking changes, listed in the changelog, and patch releases (0.1.x) never do. Composer's ^0.1 constraint does not install 0.2.

From v1.0.0, the public API below will only change in a major release; anything else (internal classes, Blade views, CSS class names other than the .io-* hooks, the JavaScript internals) may change in a minor one.

Surface Stable from 1.0
Plugin options enabled(), authorize(), resource(), navigationGroup(), navigationSort(), topbarTrigger(), segment() / segments(), pageUrl(), recorderLocale(), tenant(), tenantOptions(), tenantGroups()
Targeting ->tourTarget('key') and the data-tour attribute it renders
Data The published migrations and the models Tour, TourStep, TourCompletion, TourEvent with their documented columns and enums
Resolver rule The seven conditions listed above and the audience JSON keys roles, exclude_roles, permissions, users, segments, tenants, tenant_groups
Code-first Tour::define() and every TourDefinition method documented in this README
Interchange The JSON format (format: 1) written by onboarding:export and read by onboarding:import
Commands infinito-onboarding:install, infinito-onboarding:uninstall, onboarding:export, onboarding:import, onboarding:prune-events, onboarding:forget-user and their documented options
Query flags ?onboarding-preview, ?onboarding-record (names configurable)
Browser events infinito-onboarding:step, completed, dismissed, hint-dismissed and their detail keys, and the infinito-onboarding:replay event the overlay listens for
Config keys Everything in config/infinito-onboarding.php

Supported Filament, Livewire, Laravel and PHP versions are listed in the compatibility table; a new major of any of them may require a new major of this package. From v1.0.0, deprecations are announced one minor release ahead in the changelog.

Roadmap

Ideas for later: per-step conditions (show a step only when an element is visible), scheduling by user cohort (signup date), and a Livewire Volt-friendly component for non-Filament Livewire apps. Open a discussion if you need one of them.

Credits

License

MIT. See LICENSE.md. The compiled assets include Driver.js, also MIT: see THIRD-PARTY-LICENSES.md.