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

Reading progress

A flow derives everything on the fly from its steps and the bound subject — nothing is stored:

use RoundlyConsulting\Onboarding\Facades\Onboarding;

$flow = Onboarding::for($user);  // a copy bound to $user — or $user->onboarding()

$flow?->title;                   // "Profile Onboarding"
$flow?->isCompleted();           // bool — every required, non-excluded step is complete
$flow?->isInProgress();          // bool — at least one required step remains
$flow?->currentStep();           // the first incomplete Step (the one to resume on), or null
$flow?->steps();                 // Collection<int, Step> visible to this model (excluded steps removed)
$flow?->all();                   // Collection<int, Step> including excluded steps
$flow?->percentageCompleted();   // float across all visible steps, e.g. 66.67
$flow?->sections();              // Collection<int, SectionData> grouped by step group
$flow?->redirectToCurrentStep(); // ?RedirectResponse to the current step's target
$flow?->toArray();               // a JSON-ready array for your API/frontend
$flow?->toData();                // a typed FlowData DTO

Position and resume

// three visible steps, only the first one complete
$flow->count();                 // 3
$flow->completedCount();        // 1
$flow->position();              // 2 — "step 2 of 3"
$flow->currentStepIndex();      // 1 — 0-based, null when complete
$flow->isStarted();             // true — at least one step complete
$flow->isEmpty();               // false
$flow->percentageCompleted();   // 33.33

position() is completedCount() + 1, capped at the visible step count (and never below 1) — the human “step N of M” number. currentStepIndex() is the 0-based index of the first incomplete step, so the two can differ when steps are completed out of order:

<p>Step {{ $flow->position() }} of {{ $flow->count() }}</p>

Flow reference

MethodReturnsPurpose
steps()Collection<int, Step>Visible steps — excluded and dismissed steps removed.
all()Collection<int, Step>Every step, including excluded ones, bound and ordered.
requiredSteps() / optionalSteps()Collection<int, Step>Visible required / optional steps.
step($key) / hasStep($key)?Step / boolFind a visible step by its key.
isCompleted()boolEvery required visible step is complete.
isInProgress()boolThe opposite of isCompleted().
isStarted()boolAt least one visible step is complete.
isEmpty()boolNo visible steps — an empty flow counts as complete.
currentStep()?StepThe first incomplete visible step — the one to resume on.
currentStepIndex()?int0-based index of the current step; null when there is none.
position()int1-based “step N” number, capped at count().
count() / completedCount()intVisible steps / completed visible steps.
percentageCompleted()floatAcross all visible steps; 100.0 for an empty flow.
requiredPercentageCompleted()floatAcross required steps only; 100.0 when there are none.
sections() / groups() / section($key)Collection / ?SectionDataPer-group progress.
redirectToCurrentStep()?RedirectResponseA redirect to the current step’s target.
record(?string $key = null)FlowDispatch StepCompleted / FlowCompleted.
dismiss($key)FlowDismiss a dismissible step — through the manager to the store’s markDismissed().
toArray() / toData()array / FlowDataFrontend-ready serialization.

Visible steps exclude those whose exclusion rule matches and, with a store configured, optional steps the subject has dismissed. all() returns every step, bound and ordered.

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.