PHPackages                             idkwhoami/flux-wizards - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. idkwhoami/flux-wizards

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

idkwhoami/flux-wizards
======================

This package provides a reusable, configurable wizard livewire component styled using Flux

1.0.1(10mo ago)07MITPHPPHP ^8.3

Since Jun 17Pushed 10mo agoCompare

[ Source](https://github.com/dev-idkwhoami/flux-wizards)[ Packagist](https://packagist.org/packages/idkwhoami/flux-wizards)[ Docs](https://github.com/idkwhoami/flux-wizards)[ RSS](/packages/idkwhoami-flux-wizards/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (14)Versions (3)Used By (0)

Flux Wizards
============

[](#flux-wizards)

A Laravel package that provides functionality for building wizard-style multi-step forms with Livewire Flux.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Requirements](#requirements)
- [Usage](#usage)
    - [Quick Start](#quick-start)
    - [Creating a Wizard](#creating-a-wizard)
    - [Required Methods](#required-methods)
    - [Navigation Methods](#navigation-methods)
    - [Creating Step Views](#creating-step-views)
    - [Blade Directives](#blade-directives)
    - [Customizing the Wizard View](#customizing-the-wizard-view)
    - [Localization](#localization)
- [API Reference](#api-reference)
    - [Wizard Class](#wizard-class)
    - [Step Class](#step-class)
- [License](#license)

Features
--------

[](#features)

- Object-oriented API for defining wizard steps and their relationships
- Navigation between steps with next() and previous() methods
- Custom flow logic for determining step progression
- Validation rules for each step
- Blade directives for conditional step rendering
- Livewire integration with the HasWizard trait
- Designed for use with Livewire Flux

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require idkwhoami/flux-wizards
```

The package will automatically register its service provider.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 11+
- Livewire Flux 2.1+
- Livewire Flux Pro 2.1+

Usage
-----

[](#usage)

### Quick Start

[](#quick-start)

To quickly implement a wizard in your Livewire component:

1. Add the `HasWizard` trait to your Livewire component
2. Implement the required `createWizard()` and `complete()` methods
3. Create views for each step in your wizard
4. Use the navigation methods `nextStep()` and `previousStep()` for moving between steps

```
use Idkwhoami\FluxWizards\Concretes\Step;
use Idkwhoami\FluxWizards\Concretes\Wizard;
use Idkwhoami\FluxWizards\Traits\HasWizard;
use Livewire\Component;

class MyWizard extends Component
{
    use HasWizard;

    public array $data = [];

    protected function createWizard(): Wizard
    {
        $step1 = Step::make('step1')->label('First Step');
        $step2 = Step::make('step2')->label('Second Step');

        $step1->children([$step2]);

        return Wizard::make('my-wizard')
            ->root($step1)
            ->directory('wizards.my-wizard');
    }

    protected function complete(array $data): void
    {
        // Process the collected data
        session()->flash('message', 'Wizard completed!');
    }
}
```

### Creating a Wizard

[](#creating-a-wizard)

To create a wizard, use the `HasWizard` trait in your Livewire component and implement the required methods:

```
