NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages

Open source

Onboarding for Laravel

Install
composer require roundly-consulting/onboarding-for-laravel
Requires: PHP ^8.4 · Laravel ^12.0|^13.0

Overview

Onboarding for Laravel describes onboarding as flows of ordered steps and works out each user’s progress on the fly from the data you already have — no tables, no migrations, no config file. Register flows once, then ask any model for its next step, completion percentage, sections or a JSON-ready summary; gate routes behind completion with one middleware and announce progress as events when you choose. MIT-licensed, stateless by design and built on Laravel alone — its only runtime dependency is our own package toolkit.

What you get

Zero tables, zero config

Progress is derived live from the data you already have — no migrations, no config file, no stale boolean flags.

Many flows, one resolver

Register keyed flows or reusable flow classes, and let one resolver pick the right journey for each user.

Declarative steps

completeWhenFilled(), completeWhenTrue() and completeWhenHas() cover the common cases; closures handle the rest.

Optional steps, sections & position

Optional steps never block completion; grouped sections, “step 3 of 7” and resume support come built in.

Route guard & frontend-ready

The onboarding middleware sends unfinished users to their current step; toArray() and typed DTOs feed your UI.

Events & opt-in persistence

record() announces StepCompleted and FlowCompleted; bind your own store for dismissible steps and once-only events.

Facade or DI, with a real fake

One Onboarding facade over an injectable OnboardingManager; Onboarding::fake() captures events, records dismissals and seeds a store.

Documentation

Installation

Install via Composer — there is no config, no migration and no view to publish. Check the wiring with php artisan about.

Core concepts

Flows, steps, subjects and the manager — how progress is derived live from your data instead of being stored.

The Onboarding facade

The full Onboarding facade — register flows, read a per-subject copy with for(), pick flows with a resolver and plug in a store.

Without the facade

Skip the facade: inject OnboardingManager for the same API without static calls. The package has no action classes.

Registering flows

Register default and keyed flows, build them fluently, package reusable flow classes and manage the registry.

Defining steps

Build steps with titles, CTAs, targets, metadata, keys and ordering; decide completion and exclusion with closures.

Declarative conditions

completeWhenFilled(), completeWhenTrue(), completeWhenHas() and their exclude counterparts — one-line rules, no closures.

Optional steps

Guide users with nice-to-have steps that count toward progress but never block completion.

Preparing a model

Add GetsOnboarded to a model to read its flow, choose its default key and use null-safe one-line readers.

Reading progress

Completion, the current step, percentages, position and resume — the full Flow reading API with a reference table.

Binding the subject

Evaluate a flow for a specific model or the logged-in user — every Onboarding::for() call returns its own bound copy.

Choosing the flow per subject

Register one resolver that maps each subject to its flow key, with an automatic fallback to the default flow.

Route middleware

Gate routes behind onboarding: unfinished users are redirected to their current step, with no redirect loops.

Sections

Group steps into named sections with their own progress — the building block for multi-part setup wizards.

Localizable copy

Use translation keys as step titles and CTAs — resolved at read time, with a switch to force or disable it.

Serializing for an API

Hand a flow to your frontend as a JSON-ready array or as typed FlowData, StepData and SectionData DTOs.

Events

Announce progress with record() — StepCompleted and FlowCompleted for analytics, notifications or your own persistence.

Persistence store

Opt into dismissible optional steps and once-only events by plugging your own OnboardingStore in with Onboarding::useStore().

Extending & exceptions

Add fluent helpers with macros, know every extension point and handle the typed InvalidFlowException and InvalidStoreException.

Artisan commands

List registered flows, inspect one flow’s steps and check the package wiring from the terminal.

Testing

Onboarding::fake() captures events, records dismissals and seeds an in-memory store — or test progress straight from model data.

Requirements

PHP 8.4+ and Laravel 12 or 13 — no PHP extensions, no database tables and no config file.

Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

More ways to support, including crypto

By donating, you agree to our donation terms.

Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.