Back to Projects
Laravel Driver.js — Product Tours & Onboarding

Laravel Driver.js — Product Tours & Onboarding

A professional Laravel wrapper for Driver.js that enables developers to define interactive product tours, contextual feature highlights, and user onboarding flows entirely in PHP — using a fluent API and a single Blade directive, with zero JavaScript configuration required.

AI Summary

Eliminates the JavaScript configuration overhead of Driver.js by exposing a fluent PHP API that generates product tour steps server-side, allowing Laravel developers to define guided onboarding flows as naturally as defining routes or validation rules.

Overview

User onboarding and feature discovery are critical to product adoption — but implementing them in Laravel applications has traditionally required context-switching into JavaScript. Laravel Driver.js eliminates this by wrapping the powerful Driver.js library in a fluent PHP API, allowing developers to define multi-step tours and feature highlights entirely in server-side PHP without writing a single line of JavaScript configuration.

The Problem It Solves

Adding a product tour to a Laravel + Blade application without this package requires:

  1. Including Driver.js in your JavaScript bundle
  2. Writing JSON-based tour step definitions in .js files
  3. Building a system to track which users have completed which tours (session or database)
  4. Keeping PHP-side user logic and JavaScript-side tour logic in sync across deployments

Each of these steps represents friction. Laravel Driver.js handles the entire lifecycle server-side.

Key Features

  • Fluent PHP API — define multi-step tours with chainable PHP methods, no JSON or JS files
  • Blade directive@driverjs outputs all tour definitions in one line inside your layout
  • Per-step configuration — set title, description, element selector, side, alignment, and overlay options per step
  • Conditional display logic — show tours only to new users, specific roles, or on first page load
  • Session persistence — built-in helpers to track tour completion via Laravel session or database
  • Named tours — register multiple independent tours and trigger them by name
  • Laravel 11/12 support — built for the current framework generation with full service provider registration

Usage Example

use AmjadIqbal\LaravelDriverJs\Facades\DriverJs;

DriverJs::tour('welcome-tour')
    ->step('#nav-menu', 'Navigation', 'Use the menu to explore all sections of the application.')
    ->step('#create-button', 'Create Content', 'Click here to create your first project.')
    ->step('#settings-link', 'Settings', 'Configure your account preferences here.')
    ->showOnce()
    ->register();

In your layout:

@driverjs

Technology Stack

PHP 8.2+, Laravel 11/12, Driver.js (lightweight JavaScript overlay library), Alpine.js (optional, for reactive tour triggering). Driver.js itself is a zero-dependency, ~25KB JavaScript library with no framework requirements.

Practical Use Cases

  • SaaS applications onboarding new users to complex workflows
  • Admin panels introducing newly released features to existing users
  • Multi-role applications where different user types need different onboarding paths
  • Internal tools where contextual help overlays reduce support ticket volume
  • Portfolio and demo applications that benefit from guided feature walkthroughs

Source & License

Full source code, API documentation, and integration examples on GitHub. MIT Licensed.

Need something like this built?

Let's discuss your project requirements.

Get in Touch