Download the PHP package bambolee-digital/onboarding-package without Composer
On this page you can find all versions of the php package bambolee-digital/onboarding-package. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bambolee-digital/onboarding-package
More information about bambolee-digital/onboarding-package
Files in bambolee-digital/onboarding-package
Package onboarding-package
Short Description Laravel/FilamentPHP package for managing customizable onboarding flows.
License MIT
Informations about the package onboarding-package
OnboardingPackage
OnboardingPackage is a Laravel package that allows you to create customized onboarding flows for users, including dynamic questions, options, conditional messages, and flow control based on user responses. The package supports multiple languages using Spatie Laravel Translatable and integrates with the FilamentPHP admin panel for easy management.
Table of Contents
- Installation
- Configuration
- Usage
- Managing Questions and Options
- Defining Conditional Messages
- Controlling the Question Flow
- API Endpoints
- Submit User Response
- Get User Responses
- Usage Examples
- License
Installation
You can install the package via Composer:
After installation, publish the migration and configuration files:
Then, run the migrations:
Configuration
Filament and Spatie Laravel Translatable
Make sure that FilamentPHP and Spatie Laravel Translatable are installed and configured in your project.
Install the Filament translation plugin:
Add the plugin to your Filament panel:
Package Configuration
The package configuration file allows you to customize options as needed. The config/onboarding-package.php
file will be published in the root of your project's config
folder.
Usage
Managing Questions and Options
Access the FilamentPHP admin panel and navigate to the Questions menu.
Create a New Question
- Click on Create.
- Enter the Question Text. Use the
LocaleSwitcher
to add translations in different languages. - Select the Question Type:
- Text: The user will provide a free-text answer.
- Single Choice: The user will select one option.
- Multiple Choice: The user can select multiple options.
- Save the question.
Manage Options
For Single Choice or Multiple Choice questions:
- Within the created question, access the Options tab.
- Click Create to add a new option.
- Enter the Option Text and translations, if applicable.
- Optionally, add a Conditional Message in Markdown. This message will be displayed to the user if this option is selected.
- Set the Next Question if you want to control the flow based on the user's response.
- Save the option.
Defining Conditional Messages
Conditional messages are directly associated with options. When adding a conditional message to an option, it will be displayed to the user when that option is selected.
Controlling the Question Flow
You can define the next question the user will see after selecting a particular option:
- In the option creation or editing form, select the Next Question in the corresponding field.
- If no next question is defined, the system will follow the default order.
API Endpoints
Submit User Response
URL: /api/onboarding/responses
Method: POST
Parameters:
question_id
(integer, required): ID of the answered question.response_id
(integer, optional): ID of the selected option (for choice questions).response
(string, optional): User's response (for text questions).
Request Example:
Response Example:
Get User Responses
URL: /api/onboarding/user-responses
Method: GET
Parameters:
user_id
(integer, required): User ID.
Request Example:
Response Example:
Usage Examples
Basic Onboarding Flow
- The user starts the onboarding process.
- The application consumes the endpoint to send the user's responses.
- The backend returns the next question and any conditional messages.
- The frontend displays the question and processes the user's response.
- The flow continues until there are no more questions.
Displaying Conditional Messages
- When the user selects an option with a conditional message, that message is returned in the API response and can be displayed immediately.
Controlling the Flow Based on Responses
- By setting the Next Question on an option, you can direct the user to different paths in the onboarding flow, creating personalized experiences.
License
The OnboardingPackage is licensed under the MIT license.
All versions of onboarding-package with dependencies
laravel/framework Version ^11.0
filament/filament Version ^3.0
spatie/laravel-translatable Version ^6.8
bambolee-digital/translatable-resource-kit Version ^1.0
filament/spatie-laravel-translatable-plugin Version ^3.2