Swiftpack.co - Package - calebporzio/onboard


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

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

	    Onboard::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
Onboard::addStep('Step w/ custom attributes')
		'name' => 'Waldo',
		'shirt_color' => 'Red & White',

// Accessing them

Example middlware

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.


Stars: 50
Help us keep the lights on


Used By

Total: 0


v1.1 - Jan 15, 2018

v1.0 - Jan 14, 2017

The first release.