Skip to content
A Laravel package to help track user onboarding steps.
Branch: master
Clone or download
calebporzio Merge pull request #17 from PovilasKorop/patch-1
Edited README as it is working for me
Latest commit 0f9bec9 Aug 7, 2019


A Laravel package to help track user onboarding steps.


  • Install the package via composer
composer require calebporzio/onboard
  • Register the Service Provider and Facade in config/app.php
'providers' => [

'aliases' => [
  • Add the Calebporzio\Onboard\GetsOnboarded trait to your app's User model
class User extends Model
    use \Calebporzio\Onboard\GetsOnboarded;

Example Configuration:

Configure your steps in your App\Providers\AppServiceProvider.php

use App\User;
use Calebporzio\Onboard\OnboardFacade;

class AppServiceProvider extends ServiceProvider
    // ...

    public function boot()
	    OnboardFacade::addStep('Complete Profile')
	    	->completeIf(function (User $user) {
	    		return $user->profile->isComplete();

	    OnboardFacade::addStep('Create Your First Post')
	    	->cta('Create Post')
	    	->completeIf(function (User $user) {
	    		return $user->posts->count() > 0;


Now you can access these steps along with their state wherever you like. Here is an example blade template:

@if (auth()->user()->onboarding()->inProgress())

		@foreach (auth()->user()->onboarding()->steps as $step)
					<i class="fa fa-check-square-o fa-fw"></i>
					<s>{{ $loop->iteration }}. {{ $step->title }}</s>
					<i class="fa fa-square-o fa-fw"></i>
					{{ $loop->iteration }}. {{ $step->title }}
			<a href="{{ $step->link }}" {{ $step->complete() ? 'disabled' : '' }}>
				{{ $step->cta }}


Check out all the available features below:

$onboarding = Auth::user()->onboarding();



$onboarding->steps()->each(function($step) {

Definining custom attributes and accessing them:

// Defining the attributes
OnboardFacade::addStep('Step w/ custom attributes')
		'name' => 'Waldo',
		'shirt_color' => 'Red & White',

// Accessing them

Example middleware

If you want to ensure that your user is redirected to the next unfinished onboarding step, whenever they access your web application, you can use the following middleware as a starting point:


namespace App\Http\Middleware;

use Auth;
use Closure;

class RedirectToUnfinishedOnboardingStep
    public function handle($request, Closure $next)
        if (auth()->user()->onboarding()->inProgress()) {
            return redirect()->to(
        return $next($request);

Quick tip: Don't add this middleware to routes that update the state of the onboarding steps, your users will not be able to progress because they will be redirected back to the onboarding step.

You can’t perform that action at this time.