PHPackages                             sirajcse/laravel-safe-submit - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. sirajcse/laravel-safe-submit

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

sirajcse/laravel-safe-submit
============================

Preventing Duplicate Form Submits in laravel framework

v1.0.1(3y ago)1105PHPPHP &gt;=5.6.0

Since Aug 31Pushed 3y ago1 watchersCompare

[ Source](https://github.com/SirajCse/laravel-safe-submit)[ Packagist](https://packagist.org/packages/sirajcse/laravel-safe-submit)[ RSS](/packages/sirajcse-laravel-safe-submit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

README
------

[](#readme)

> > >

\##Preventing Duplicate Form Submits in Laravel framework
=========================================================

[](#preventing-duplicate-form--submits--in-laravel-framework)

Quickly submitting a form more than once can store duplicate entity in database. This package handle the server-side solution while submitting the data.

Installation
============

[](#installation)

```
composer require SirajCSE/laravel-safe-submit

```

Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

### Laravel without auto-discovery:

[](#laravel-without-auto-discovery)

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
SirajCSE\LaravelSafeSubmit\SafeSubmitServiceProvider::class,
```

If you want to use the facade to log messages, add this to your facades in app.php:

```
'SafeSubmit' => SirajCSE\LaravelSafeSubmit\SafeSubmit::class,
```

### Laravel Kernel (Middleware):

[](#laravel-kernel-middleware)

Make sure to add GenerateSafeSubmitToken to your Kernel list in `app/Http/Kernel.php`.

```
    \SirajCSE\LaravelSafeSubmit\Middleware\GenerateSafeSubmitToken::class
```

Like this

```
    protected $middlewareGroups = [
            'web' => [
                ...
                \SirajCSE\LaravelSafeSubmit\Middleware\GenerateSafeSubmitToken::class,
            ],
        ];
```

### Laravel Controller:

[](#laravel-controller)

Make sure to add \_\_construct middleware of your 'method' and 'return' intended function

```
        use SirajCSE\LaravelSafeSubmit\SafeSubmit;
        use SirajCSE\LaravelSafeSubmit\Middleware\HandleSafeSubmit;
```

Example

```
    use SirajCSE\LaravelSafeSubmit\SafeSubmit;
    use SirajCSE\LaravelSafeSubmit\Middleware\HandleSafeSubmit;

    class UserController extends Controller
    {
        public function __construct()
        {
            $this->middleware(HandleSafeSubmit::class)->only('store');
        }

        public function store(Request $request, SafeSubmit $safeSubmit)
        {
            $user=User::create($data);
            return $safeSubmit->intended(route('users.show', $user->id));
        }
    }
```

### Laravel Blade:

[](#laravel-blade)

Add '@safesubmit' inside Form below Like @csrf

```
        @safesubmit
```

Example

```

       @csrf
       @safesubmit

       Create User

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

1349d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/sirajcse-laravel-safe-submit/health.svg)

```
[![Health](https://phpackages.com/badges/sirajcse-laravel-safe-submit/health.svg)](https://phpackages.com/packages/sirajcse-laravel-safe-submit)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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