A Laravel Livewire-based multi-step form application for collecting user subscription details. This application supports both Free and Premium subscription types, guiding users through multiple steps to collect Personal Details, Address Details, and Payment Details (for Premium users).
This project uses the following technologies:
- PHP 8
- MySQL
- Laravel 11
- Livewire 3
This project is designed to demonstrate a clean implementation of a multi-step user registration form with dynamic navigation and validation on each step. The following steps are included:
- Personal Details
- Name, Email, Phone, and Subscription Type selection.
- Address Details
- Address Line 1, Address Line 2, City, State, Postal Code, Country.
- Payment Details(Credit Card) (for Premium subscription only)
- Card Number, Expiry Date, CVV.
- Confirmation
- Displays all the user-submitted details for review before final submission.
- Dynamic step navigation.
- Step-specific validation.
- Secure handling of sensitive user data (e.g., masking payment details).
- Organized code structure using Livewire components.
- Proper relationships between database models.
- Validation rules for Email address and credit card details.
- Encrypted credit card details stored in the database.
- Subscriberform: Handles the multi-step form logic and data submission.
- File Path:
app/Livewire/Subscriberform.php
- File Path:
-
Multi-step Form View: Renders the multi-step form UI.
- File Path:
resources/views/livewire/subscriberform.blade.php
- File Path:
-
Subscribers List View: Displays a list of submitted subscribers.
- File Path:
resources/views/subscribers-list.blade.php
- File Path:
- Subscriber: Represents a user in the subscription system.
- File Path:
app/Models/Subscriber.php
- File Path:
- Address: Stores user address details.
- File Path:
app/Models/Address.php
- File Path:
- Payment: Stores user payment details for Premium subscriptions.
- File Path:
app/Models/Payment.php
- File Path:
To set up this Laravel project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/arslanramay/streamplus-multistep-forms.git cd streamplus-multistep-forms
-
Install Dependencies:
composer install npm install npm run dev
-
Set Up Environment Variables:
- Copy
.env.example
to.env
.
cp .env.example .env
- Configure database credentials and other necessary settings in the
.env
file.
- Copy
-
Generate Application Key:
php artisan key:generate
-
Run Migrations:
php artisan migrate
-
Start the Development Server:
php artisan serve
-
Access the Application:
- Open your browser and navigate to
http://127.0.0.1:8000
.
- Open your browser and navigate to
-
Testing the Application:
- Complete the multi-step form for Free and Premium subscriptions.
- After submission, verify the data on the Subscribers List page by navigating to
/subscribers-list
.
- Start by selecting a subscription type (Free or Premium) in Step 1.
- Fill in the required details for each step.
- For Premium subscriptions, enter payment details in Step 3.
- Review all information on the Confirmation page (Step 4) before submitting.
- Successfully submitted data will be stored in the database and displayed on the Subscribers List page.
This project is open-source and available under the MIT License. Developed by Arslan Ramay
For any issues or questions, feel free to reach out or create an issue on the GitHub repository.