amjadiqbal/laravel-driver-js
Composer 安装命令:
composer require amjadiqbal/laravel-driver-js
包简介
A professional Laravel wrapper for Driver.js. Easily create interactive product tours, feature highlights, and user onboarding flows using a fluent PHP API.
关键字:
README 文档
README
amjadiqbal/laravel-driver-js
Professional Laravel wrapper for Driver.js (v1.3+). Easily create interactive product tours, feature highlights, and user onboarding flows using a fluent PHP API.
- SEO: Laravel product tours, interactive onboarding, feature highlights, guided walkthroughs, Driver.js for Laravel
- Website: https://driverjs.com
Issues • Install • Usage • API • Config
Requirements
- PHP ^8.2
- Laravel 10 or 11
- Driver.js v1.3+
Installation
composer require amjadiqbal/laravel-driver-js php artisan vendor:publish --tag=driver-js-config php artisan vendor:publish --tag=driver-js-views
Features
- Fluent PHP API mirroring Driver.js options and actions
- Blade component for quick start
- Config publishing with sensible defaults and CDN control
- Callback wiring from PHP config to global JS functions
- Pest tests via Orchestra Testbench
- GitHub Actions CI and Laravel Pint code style
Usage
Fluent API
use AmjadIqbal\DriverJS\Facades\Driver; $tour = Driver::make() ->allowClose(true) ->overlayColor('rgba(0,0,0,0.6)') ->addStep('#selector', 'Title', 'Description') ->addStep('.cta', 'Get Started', 'Click here to begin') ->drive(); $json = $tour->toJson();
Blade Component
<x-driver-js :steps="$steps" :config="['overlayColor' => 'rgba(0,0,0,0.6)']" />
Where $steps is an array:
$steps = [ [ 'element' => '#selector', 'popover' => [ 'title' => 'Title', 'description' => 'Description', ], ], ];
Configuration
config/driver-js.php
return [ 'cdn_js' => 'https://unpkg.com/driver.js/dist/driver.min.js', 'cdn_css' => 'https://unpkg.com/driver.js/dist/driver.min.css', 'allowClose' => true, 'overlayColor' => 'rgba(0, 0, 0, 0.5)', 'opacity' => 0.6, ];
You can override any of these values per-tour via the Blade :config prop or by constructing a builder with initial config: Driver::make(['overlayColor' => '...']).
CDN keys (cdn_js, cdn_css) are used by the Blade component to load assets and are not forwarded to the Driver constructor.
Methods Mapping
| Fluent Method | Driver.js Option / Action | Notes |
|---|---|---|
| allowClose(bool) | allowClose | Enable closing overlay |
| overlayColor(string) | overlayColor | RGBA or HEX |
| opacity(float) | opacity | Overlay opacity |
| set(key, value) | any config key | Direct set |
| addStep(selector, title, description, options) | defineSteps -> step | Popover title/description |
| defineSteps(array) | defineSteps | Bulk steps |
| drive() | drive | Start tour |
| highlight(selector) | highlight | Highlight element |
| moveNext() | moveNext | Next step |
| movePrevious() | movePrevious | Previous step |
| destroy() | destroy | Destroy tour |
| onHighlighting(handler) | onHighlighting callback | Provide global callback name |
Blade Component Props
steps: array of Driver.js steps (as shown above)config: array of overrides; merged withconfig('driver-js')
Callbacks
- Provide callback names as strings, e.g.
onHighlighting('onHighlight') - Ensure a matching global function exists:
window.onHighlight = function (element) { ... } - The component resolves names to
windowfunctions before initializing Driver
Step Options
- The
addStepmethod supports anoptionsarray to pass step-level options supported by Driver.js (e.g., popover position, padding). These are forwarded as-is to the step object.
Documentation
- API Docs: https://driverjs.com
- YouTube: Tutorials and walkthroughs on product tours and onboarding
- DEV Community: Implementation guides and tips
CI & Code Style
- Tests: GitHub Actions workflow runs Pest on supported PHP versions
- Code Style: Laravel Pint workflow validates formatting (non-mutating with
--test) - Local commands:
composer test
composer lint
License
MIT
amjadiqbal/laravel-driver-js 适用场景与选型建议
amjadiqbal/laravel-driver-js 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「laravel package」 「onboarding」 「driverjs」 「Fluent API」 「Driver.js」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 amjadiqbal/laravel-driver-js 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 amjadiqbal/laravel-driver-js 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 amjadiqbal/laravel-driver-js 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP module for communicating with the RingCaptcha API
Simple ASCII output of array data
Fitbank SDK for PHP
A Laravel package for managing interstitials (modals, full-page redirects, inline content blocks) with configurable triggers, audience targeting, and frequency control.
Alfabank REST API integration
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 37
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-23
