lexal/laravel-stepped-form-submitter

Stepped Form submitter for Laravel & Lumen.
481 1
Install
composer require lexal/laravel-stepped-form-submitter
Latest Version:v4.0.1
PHP:>=8.2
License:MIT
Last Updated:Aug 11, 2026
Links: GitHub  ·  Packagist
Maintainer: alexxxkk

Stepped Form Submitter for Laravel

PHPUnit, PHPCS, PHPStan Tests

The package is based on the Form Submitter and built for the Laravel framework.

Table of Contents

  1. Requirements
  2. Installation
  3. Configuration
  4. Usage
  5. License

Requirements

PHP: >=8.2

Laravel: ^11.0 || ^12.0

Installation

Via Composer

composer require lexal/laravel-stepped-form-submitter

Configuration

Publish the config

Run the following command to publish the package config file:

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

Available config options

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

  1. transaction_class - place a class name, instance or service alias which the FormSubmitter will use to handle transactions. Place null or remove config to disable transactions.

    'transaction_class' => DatabaseTransaction::class,
    
  2. submitters - specify at least one form submitter that the stepped form will use to submit entity on FormFinished event. Must implement FormSubmitterInterface.

    'submitters' => [
        // list of form submitters
    ],
    

Usage

  1. Publish configuration file.

  2. Add form transaction implementation, if necessary.

    use Lexal\FormSubmitter\Transaction\TransactionInterface;
    
    final class DatabaseTransaction implements TransactionInterface
    {
         public function start(): void
         {
             // start transaction
         }
    
         public function commit(): void
         {
             // commit transaction
         }
    
         public function rollback(): void
         {
             // rollback transaction
         }
    }
    
  3. Create custom form submitters.

    use Lexal\FormSubmitter\FormSubmitterInterface;
    
    final class CustomerFormSubmitter implements FormSubmitterInterface
    {
        public function supportsSubmitting(mixed $entity): bool
        {
            return $entity instanceof Customer;
        }
    
        public function submit(mixed $entity): mixed
        {
            // save entity to the database
    
            return $entity;
        }
    }
    
  4. Update configuration file. Add form submitters and transaction class (if necessary).

    return [
        'transaction_class' => DatabaseTransaction::class,
        'submitters' => [
            CustomerFormSubmitter::class,
        ],
    ];
    
  5. Form submitter will call your custom form submitter automatically if it supports submitting of stepped-form entity.


License

Laravel Stepped Form Submitter is licensed under the MIT License. See LICENSE for the full license text.

Related Packages

jlcd/api-cielo30-laravel

Laravel Provider for Cielo's 3.0 API

224,633 17
nilportugues/laravel5-json-api-dingo

Laravel5 JSONAPI and Dingo together to build APIs fast

1,498 30
laravel/lumen-framework

The Laravel Lumen Framework.

27,203,595 1,507