Laravel Packages

A Package for Onboarding Users in Laravel Apps

Published
A Package for Onboarding Users in Laravel Apps image

Laravel Onboard is a Laravel package to help track user onboarding steps created by Spatie:

Here's a quick example taken from the project readme on using this package to create onboarding steps:

use App\User;
use Spatie\Onboard\Facades\Onboard;
 
// You can add onboarding steps in a `boot()` method within a service provider
Onboard::addStep('Complete Profile')
->link('/profile')
->cta('Complete')
->completeIf(function (User $user) {
return $user->profile->isComplete();
});
 
Onboard::addStep('Create Your First Post')
->link('/post/create')
->cta('Create Post')
->completeIf(function (User $user) {
return $user->posts->count() > 0;
});

To get a user's onboarding status—among other things—the package has a nice API for accessing things like percentage complete, in progress, finished, and details about individual steps:

/** @var \Spatie\Onboard\OnboardingManager $onboarding **/
$onboarding = Auth::user()->onboarding();
 
$onboarding->inProgress();
 
$onboarding->percentageCompleted();
 
$onboarding->finished();
 
$onboarding->steps()->each(function($step) {
$step->title;
$step->cta;
$step->link;
$step->complete();
$step->incomplete();
});

Additionally, this package supports features such as:

  • Conditionally excluding steps with custom logic
  • Defining custom attributes on a step
  • Use middleware to ensure a user completes onboarding before they are allowed to use certain features
  • And more

You can get started with this package by checking it out on GitHub at spatie/laravel-onboard. Their blog post can also give you some examples and further details on how you can use this package.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Sponsored

laravelcloud logo
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud

The latest

View all →
Image Dominant Color and HEIC Support in Laravel 13.24 image

Image Dominant Color and HEIC Support in Laravel 13.24

Read article
Official Laravel Zed Extension: LSP for PHP & Blade image

Official Laravel Zed Extension: LSP for PHP & Blade

Read article
Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD image

Laravel Head: Manage Meta Tags, Open Graph, and JSON-LD

Read article
PhpStorm 2026.2 Released image

PhpStorm 2026.2 Released

Read article
Laravel Doctor: Diagnose Your App With One Artisan Command image

Laravel Doctor: Diagnose Your App With One Artisan Command

Read article
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article