PHPackages                             thehiredgun/formkit - 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. thehiredgun/formkit

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

thehiredgun/formkit
===================

A combined back- and front-end package to manage data-submissions and forms in Laravel

v0.8.0(8y ago)032MITPHPPHP &gt;=7.0.0

Since Jun 15Pushed 8y agoCompare

[ Source](https://github.com/thehiredgun/formkit)[ Packagist](https://packagist.org/packages/thehiredgun/formkit)[ RSS](/packages/thehiredgun-formkit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (24)Used By (0)

formkit
=======

[](#formkit)

A nice bit of kit to help manage form-submissions in Laravel

Introduction
------------

[](#introduction)

FormKit is a two-part package:

- FormKit\\SubmissionKit dramatically streamlines the work you have to do on the back-end to manage data-submissions and forms
- FormKit\\TemplateKit dramatically reduces the amount of front-end templating you have to do to build nice-looking forms using Blade &amp; Bootstrap
- Together, a developer can get rapidly build out comprehensive solutions to manage all different kinds of data, then tweak on an as-needed basis

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

[](#installation)

Recommended installation is via [Composer](https://getcomposer.org):

`composer require thehiredgun/formkit`

or, add this to your composer.json:

```
"require": {
    ...,
    "thehiredgun/formkit": "^1.0",
    ...
}

```

SubmissionKit Quick-Start
-------------------------

[](#submissionkit-quick-start)

### For traditional Web Application use:

[](#for-traditional-web-application-use)

We're going to use a single(!) controller method to manage getting a form and handling a form-submission: In routes/web.php:

```
Route::match(['get', 'post'], '/books/{book}/edit', 'BookController@form');
Route::match(['get', 'post'], '/books/add', 'BookController@form');
```

Then, in app/Http/Controllers/BookController.php:

```
...
use App\Models\Eloquent\Book;
use Illuminate\Http\Request;
use TheHiredGun\FormKit\SubmissionKit\SubmissionKit;
...
    public function form(Request $request, Book $book = null)
    {
        // define your rules for the form.
        // multi-dimensional array is the preferred style, but you can use an array of strings, as well
        $rules = [
            'title' => [
                'required',
                'string',
            ],
            'author' => [
                'required',
                'string',
            ],
            'published_on' => [
                'required',
                'date_format:Y-m-d',
            ],
        ];
        $form = new SubmissionKit($request, $rules);
        // if the form has been submitted
        if ($request->isMethod('post')) {
            $form->validate();              // validate the form
            $form->setProperties($book);    // set the properties on the $book where the values are valid
            if ($form->isValid()) {
                $book->save();

                return redirect()->route('books');
            }
        }

        return view('books.form', [
            'book'   => $book,
            'errors' => $submissionKit->getErrors(),
        ]);
    }
```

### SubmissionKit For RESTful API usage:

[](#submissionkit-for-restful-api-usage)

Here we'll use the SubmissionKit in two separate methods: one for POST, and one for PUT In routes/api.php:

```
Route::post('/books', 'BookController@post');
Route::put('/books/{book}', 'BookController@put');
```

And the BookController:

```
...
    public function post(Request $request)
    {
        $rules = [
            'title' => [
                'required',
                'string',
            ],
            'author' => [
                'required',
                'string',
            ],
            'published_on' => [
                'required',
                'date_format:Y-m-d',
            ],
        ];
        $form = new SubmissionKit($request, $rules);
        $form->validate();              // validate the form
        $form->setProperties(new Book());    // set the properties on the $book where the values are valid
        if ($form->isValid()) {
            $book->save();

            return response($book, 201);
        }

        return response([
            'errors' => $submissionKit->getErrors(),
        ], 400);
    }

    public function put(Request $request, Book $book)
    {
        $rules = [
            'title' => [
                'required',
                'string',
            ],
            'author' => [
                'required',
                'string',
            ],
            'published_on' => [
                'required',
                'date_format:Y-m-d',
            ],
        ];
        $form = new SubmissionKit($request, $rules);
        $form->validate();              // validate the form
        $form->setProperties($book);    // set the properties on the $book where the values are valid
        if ($form->isValid()) {
            $book->save();

            return response(200);
        }

        return response([
            'errors' => $submissionKit->getErrors(),
        ], 400);
    }
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Recently: every ~28 days

Total

15

Last Release

3091d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ca5f709df7ca86d44b039a8b014727eeaaa72a0a776fda22a1f0e63b0bd546d?d=identicon)[thehiredgun](/maintainers/thehiredgun)

---

Tags

middlewarelaravelvalidatorvalidationlibrarybootstrapformbackendfrontendForms

### Embed Badge

![Health badge](/badges/thehiredgun-formkit/health.svg)

```
[![Health](https://phpackages.com/badges/thehiredgun-formkit/health.svg)](https://phpackages.com/packages/thehiredgun-formkit)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1036.7k3](/packages/carsdotcom-laravel-json-schema)[stuyam/laravel-phone-validator

A phone validator for Laravel using the free Twilio phone lookup service.

2861.3k](/packages/stuyam-laravel-phone-validator)[laravel-validation-rules/timezone

Validate that a given timezone is valid.

2119.0k](/packages/laravel-validation-rules-timezone)

PHPackages © 2026

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