PHPackages                             lexal/laravel-stepped-form - 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. lexal/laravel-stepped-form

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

lexal/laravel-stepped-form
==========================

Stepped Form for Laravel.

v4.0.1(3mo ago)34891MITPHPPHP &gt;=8.2CI passing

Since Jan 16Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/lexalium/laravel-stepped-form)[ Packagist](https://packagist.org/packages/lexal/laravel-stepped-form)[ RSS](/packages/lexal-laravel-stepped-form/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (26)Versions (10)Used By (0)

Laravel Stepped Form
====================

[](#laravel-stepped-form)

[![PHPUnit, PHPCS, PHPStan Tests](https://github.com/lexalium/laravel-stepped-form/actions/workflows/tests.yml/badge.svg)](https://github.com/lexalium/laravel-stepped-form/actions/workflows/tests.yml)

The package is based on the [HTTP Stepped Form](https://github.com/lexalium/http-stepped-form) and built for Laravel framework.

Table of Contents

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Configuration](#configuration)
    - [Publish the config](#publish-the-config)
    - [Available config options](#available-config-options)
4. [Usage](#usage)
5. [License](#license)

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

[](#requirements)

**PHP:** &gt;=8.2

**Laravel:** ^11.0 || ^12.0

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

[](#installation)

Via Composer

```
composer require lexal/laravel-stepped-form

```

([back to top](#readme-top))

Configuration
-------------

[](#configuration)

### Publish the config

[](#publish-the-config)

Run the following command to publish the package config file:

```
php artisan vendor:publish --provider="Lexal\LaravelSteppedForm\ServiceProvider\ServiceProvider"
```

### Available config options

[](#available-config-options)

The configuration file `config/stepped-form.php` has the following options:

1. `renderer` - contains Renderer class, instance or service alias that translates step's template definition into the response. Must implement `Lexal\HttpSteppedForm\Renderer\RendererInterface`;
2. `redirector` - contains Redirector class, instance or service alias that redirects user between form steps. Must implement `Lexal\HttpSteppedForm\Routing\RedirectorInterface`;
3. `event_dispatcher` - contains Event Dispatcher class, instance or service alias that dispatches form events. Must implement `Lexal\SteppedForm\EventDispatcher\EventDispatcherInterface`;
4. `exception_normalizers` - contains exception normalizers that the form uses for normalizing SteppedFormException into the Response instance. Read more about them in the [HTTP Stepped Form](https://github.com/lexalium/http-stepped-form#exception-normalizers)docs;
5. `forms` - contains array of all application forms definitions. Form definition must have builder class for dynamic forms or array of steps for the static forms, settings class and storage where the form stores its data.

([back to top](#readme-top))

Usage
-----

[](#usage)

1. [Publish configuration file](#publish-the-config).
2. Replace redirector, renderer and event dispatcher with your own implementation and add custom exception normalizers, if necessary.
3. Declare form settings.

    ```
     use Lexal\HttpSteppedForm\Settings\FormSettingsInterface;
     use Lexal\SteppedForm\Step\StepKey;

     final class FormSettings implements FormSettingsInterface
     {
         public function getStepUrl(StepKey $key): string
         {
             // return step URL
         }

         public function getUrlBeforeStart(): string
         {
             // returns a URL to redirect to when there is no previously renderable step
         }

         public function getUrlAfterFinish(): string
         {
             // return a URL to redirect to when the form was finishing
         }
     }

     $formSettings = new FormSettings();
    ```
4. Add forms definitions.

    - Static form ```
        return [
           // ...

           'forms' => [
               'customer' => [
                   'steps' => [
                       'customer' => CustomerStep::class,
                       'broker' => BrokerStep::class,
                       'confirmation' => ConfirmationStep::class,
                       // other steps
                   ],
                   'settings_class' => FormSettings::class,
                   'storage' => SessionStorage::class,
                   'session_key_storage' => SessionSessionKeyStorage::class,
               ],
           ],

           // ...
        ];
        ```
    - Dynamic form ```
        return [
           // ...

           'forms' => [
               'customer' => [
                   'builder_class' => CustomBuilder::class,
                   'settings_class' => FormSettings::class,
                   'storage' => SessionStorage::class,
                   'session_key_storage' => SessionSessionKeyStorage::class,
               ],
           ],

           // ...
        ];
        ```
5. Use Stepped Form in you controller. Stepped Form service is registered under "stepped-form.*{{form key}}*" alias in the container.

    **ServiceProvider.php**

    ```
    use Lexal\HttpSteppedForm\SteppedFormInterface;

    $this->app->when(CustomerController::class)
         ->needs(SteppedFormInterface::class)
         ->give('stepped-form.customer');
    ```

    **CustomerController.php**

    ```
    use Lexal\HttpSteppedForm\SteppedFormInterface;

    final class CustomerController
    {
        public function __construct(private readonly SteppedFormInterface $form)
        {
        }

        // POST /customers
        public function start(): Response
        {
            return $this->form->start(new Customer(), /* nothing or customer id to split different sessions */);
        }

        // GET /customers/step/{step-key}
        public function render(string $key): Response
        {
            return $this->form->render($key);
        }

        // POST /customers/step/{step-key}
        public function handle(Request $request, string $key): Response
        {
            return $this->form->handle($key, $request);
        }

        // POST /customers/cansel
        public function cancel(): Response
        {
            return $this->form->cancel(route('customer.index'));
        }
    }
    ```

See configuration file for more information.

([back to top](#readme-top))

License
-------

[](#license)

Laravel Stepped Form is licensed under the MIT License. See [LICENSE](LICENSE) for the full license text.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance82

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 52.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~191 days

Recently: every ~205 days

Total

9

Last Release

96d ago

Major Versions

1.3.0 → v2.0.02023-12-30

v2.0.0 → v3.0.02025-04-06

v3.0.0 → v4.0.02025-07-06

PHP version history (3 changes)v1.0.0PHP ^8.0

v2.0.0PHP &gt;=8.1

v4.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e58c7184c9ec2cebd6c37bb1fbc98870dc0f43abeccc4f0c873edf364a11c321?d=identicon)[alexxxkk](/maintainers/alexxxkk)

---

Top Contributors

[![lexalium](https://avatars.githubusercontent.com/u/28488207?v=4)](https://github.com/lexalium "lexalium (11 commits)")[![GalinaGorokhovaItransition](https://avatars.githubusercontent.com/u/105951990?v=4)](https://github.com/GalinaGorokhovaItransition "GalinaGorokhovaItransition (5 commits)")[![GorokhovaGalina](https://avatars.githubusercontent.com/u/105951990?v=4)](https://github.com/GorokhovaGalina "GorokhovaGalina (5 commits)")

---

Tags

laravelmulti-step-formmulti stepstepped-formdynamic stepped-form

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lexal-laravel-stepped-form/health.svg)

```
[![Health](https://phpackages.com/badges/lexal-laravel-stepped-form/health.svg)](https://phpackages.com/packages/lexal-laravel-stepped-form)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k21.5M594](/packages/laravel-boost)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
