PHPackages                             abdallahmohammed/laravel-multistep-forms - 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. abdallahmohammed/laravel-multistep-forms

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

abdallahmohammed/laravel-multistep-forms
========================================

Laravel Multistep Forms Builder

v1.0.3(5y ago)1239MITPHPPHP ^7.4|^8.0

Since Jan 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/AbdallaMohammed/laravel-multistep-forms)[ Packagist](https://packagist.org/packages/abdallahmohammed/laravel-multistep-forms)[ RSS](/packages/abdallahmohammed-laravel-multistep-forms/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (8)Versions (5)Used By (0)

Laravel Multistep Form
----------------------

[](#laravel-multistep-form)

[![Build Status](https://camo.githubusercontent.com/e6c5dc97bf3a7731450d49e602ab0b3128e761755920fea11823695cfa9265e3/68747470733a2f2f7472617669732d63692e6f72672f416264616c6c614d6f68616d6d65642f6c61726176656c2d6d756c7469737465702d666f726d732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AbdallaMohammed/laravel-multistep-forms)

- [Installation](#installation)
- [Example Usage](#example-usage)
- [Steps Usage](#steps-usage)
    - [Before](#before-step)
    - [After](#after-step)
    - [Dynamic](#dynamic-step)
- [Helper Methods](#helper-methods)

### Installation

[](#installation)

```
composer require abdallahmohammed/laravel-multistep-forms
```

### Example Usage

[](#example-usage)

```
use AbdallaMohammed\Form\Form;
use Illuminate\Support\Facades\Route;

Route::get('form', function () {
    return app(Form::class)->make(function (Form $form) {
        // Create a step instance and define rules, messages and attributes
        $form->step()->rules([
            'name' => ['required', 'string'],
        ])->messages([
            'required' => ':attribute Required',
        ])->attributes([
            'name' => 'Name',
        ]);

        // Add another step with dynamic rules
        $form->step()->dynamicRules();
    });
})->name('form');
```

### Steps Usage

[](#steps-usage)

#### Before Step

[](#before-step)

Define a callback to fired **before** a step has been validated.

> Return a response from this hook to return early before validation occurs.

`before($step, Closure $closure)`

> $step could be Step instance, or the number of the step.

#### After Step

[](#after-step)

Define a callback to fired **after** a step has been validated. Step Number or \* for all.

> Return a response from this hook to return early before the form step is incremented.

`after($step, Closure $closure)`

> $step could be Step instance, or the number of the step.

#### Dynamic Step

[](#dynamic-step)

You can set a step as dynamic, so the step will take it's **rules**, **messages** and **attributes** from the request.

For example

```
use AbdallaMohammed\Form\Form;
use Illuminate\Support\Facades\Route;

Route::get('form', function () {
    return app(Form::class)->make(function (Form $form) {
        ...
        $form->step()->dynamicRules()->messages([
            'foo' => 'bar',
        ]);
        ...
    });
})->name('form');
```

From the example we have defined the **attributes** without the **rules**, so we must send the rules with the request. Here it is the example of the request body.

```
{
  "step": 1,
  "1.rules": {
    "name": ["required", "string"]
  }
}
```

**1.rules** is a reference to first step rules.

> You can change **1** to the number of the dynamic step.

As the previous example you can send **1.messages** and **1.attributes** in the request body.

### Helper Methods

[](#helper-methods)

#### `stepConfig(?int $step = null)`

[](#stepconfigint-step--null)

Get the current step config, or a specific step config.

#### `getValue(string $key, $fallback = null)`

[](#getvaluestring-key-fallback--null)

Get a field value from the form state (session / old input) or fallback to a default.

#### `setValue(string $key, $value)`

[](#setvaluestring-key-value)

Set a field value from the session form state.

#### `currentStep()`

[](#currentstep)

Get the current saved step number.

#### `requestedStep()`

[](#requestedstep)

Get the requested step number.

#### `isStep(int $step = 1)`

[](#isstepint-step--1)

Get the current step number.

#### `isLastStep()`

[](#islaststep)

Determine if the current step the last step.

#### `isPast(int $step, $truthy = true, $falsy = false)`

[](#ispastint-step-truthy--true-falsy--false)

Determine if the specified step is in the past.

#### `isActive(int $step, $truthy = true, $falsy = false)`

[](#isactiveint-step-truthy--true-falsy--false)

Determine if the specified step is active.

#### `isNext(int $step, $truthy = true, $falsy = false)`

[](#isnextint-step-truthy--true-falsy--false)

Determine if the specified step is in the next.

#### `toCollection`

[](#tocollection)

Get the array representation of the form state as a collection.

#### `toArray`

[](#toarray)

Get the array representation of the form state.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

4

Last Release

2001d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/528edaaf4cec2c4872feecfe766beb012b234e9479334fa3cdf216d7b180fca9?d=identicon)[AbdullahMohamedRezk](/maintainers/AbdullahMohamedRezk)

---

Top Contributors

[![AbdallaMohammed](https://avatars.githubusercontent.com/u/41541325?v=4)](https://github.com/AbdallaMohammed "AbdallaMohammed (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/abdallahmohammed-laravel-multistep-forms/health.svg)

```
[![Health](https://phpackages.com/badges/abdallahmohammed-laravel-multistep-forms/health.svg)](https://phpackages.com/packages/abdallahmohammed-laravel-multistep-forms)
```

###  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.3M149](/packages/laravel-mcp)[illuminate/routing

The Illuminate Routing package.

1419.2M3.0k](/packages/illuminate-routing)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M130](/packages/roots-acorn)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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