Download the PHP package dgtlinf/user-onboarding without Composer
On this page you can find all versions of the php package dgtlinf/user-onboarding. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dgtlinf/user-onboarding
More information about dgtlinf/user-onboarding
Files in dgtlinf/user-onboarding
Package user-onboarding
Short Description A lightweight, stateless user onboarding flow manager for Laravel applications.
License MIT
Informations about the package user-onboarding
User Onboarding for Laravel 10+
A lightweight, stateless user onboarding flow manager for Laravel applications. Define onboarding steps entirely in code or in configuration, use middleware to restrict access, and listen to onboarding events — all without a database.
🚀 Installation
Install the package via Composer:
Then publish the config file and installation assets using the included install command:
This will publish the configuration file:
⚙️ Defining Flows
You can define your onboarding steps in two different ways — depending on whether your flow is static (defined in config) or dynamic (defined programmatically).
1. Config-Based Flows (Recommended)
This is the most common approach. Define your flows in config/user-onboarding.php:
The middleware and facade will automatically use these definitions:
2. Dynamic Flows (Programmatic)
You can also define steps directly in code — perfect for custom setups, role-based flows, or feature flags.
In a Controller
In AppServiceProvider (Global Logic)
You can register a reusable macro for dynamic onboarding flows:
Now anywhere in your app, you can call:
🧬 Basic Usage
If you prefer configuration-based flows, use:
🛡️ Middleware Protection
You can easily protect routes to ensure users can only access them after completing onboarding.
Protect Entire Routes
If a user has not completed onboarding, they’ll be redirected to /onboarding (or your configured path).
Require a Specific Step
If the user hasn’t completed the verify_email step, the middleware denies access.
🤓 Creating a Custom Middleware
By default, this package includes the middleware
Dgtlinf\\UserOnboarding\\Http\\Middleware\\EnsureUserOnboardingStepCompleted.
You can register it manually or create your own to customize the behavior (for example, JSON vs. redirect responses).
1. Using the built-in middleware
Register it in your app/Http/Kernel.php if not already auto-discovered:
Then use it in your routes:
2. Creating your own middleware
If you need different behavior (e.g. API response instead of redirect), you can create your own middleware and use the package’s API directly:
Then register and use it:
✅ Tip: You can also use this pattern to create per-role or per-guard middleware variants:
🧬 Example Workflow (Blade or Inertia)
When a user tries to access a protected route, the middleware redirects them to /onboarding. You can use the flow object to determine which step to render next.
Controller Example
Inertia/Vue Example
Blade Example
When a user completes a step (e.g., submits a form):
The next time the onboarding view loads, the next step will automatically render.
🧱 Listening to Events
The package dispatches the following events automatically:
| Event | Description |
|---|---|
OnboardingStarted |
Fired when a flow begins via UserOnboarding::start() |
StepCompleted |
Fired when a step is completed manually or programmatically |
OnboardingCompleted |
Fired when all steps are completed |
Example Listener
📡 Events Overview
OnboardingStarted→ emitted when a user begins onboardingStepCompleted→ emitted when a user finishes a stepOnboardingCompleted→ emitted when a flow is fully done
Each event carries the $user and $flow (and $step when relevant).
🥉 Example Use Cases
- Block certain routes until user setup is finished
- Show onboarding progress bar in the UI
- Trigger reminders via queued listeners
- Log onboarding analytics and completions
- Connect with external CRM or email campaigns
⚙️ Publishing & Customization
You can re-publish configuration anytime:
🧮 Tech Notes
- Stateless: No database persistence — each step is evaluated live.
- Extensible: Add events, listeners, and custom middleware.
- Minimal: Only
spatie/laravel-package-toolsandilluminate/supportare required.
🖦 License
MIT License © Digital Infinity
All versions of user-onboarding with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.92