PHPackages                             khodakhah/laravel-inertia-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. khodakhah/laravel-inertia-form

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

khodakhah/laravel-inertia-form
==============================

A package for Inertia.js forms integration in Laravel

v0.0.1-alpha(2y ago)016MITPHPPHP &gt;=8.1

Since Sep 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/khodakhah/laravel-inertia-form)[ Packagist](https://packagist.org/packages/khodakhah/laravel-inertia-form)[ RSS](/packages/khodakhah-laravel-inertia-form/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

[laravel-inertia-form](https://github.com/khodakhah/laravel-inertia-form)
=========================================================================

[](#laravel-inertia-form)

A simple package to handle forms in Laravel with InertiaJS.

This is the backend pair of [InertiaForm](https://github.com/khodakhah/inertia-form) package.

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

[](#requirements)

- PHP ^8.1 || ^8.2

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

[](#installation)

```
composer require khodakhah/larave-inertia-form
```

Usage
-----

[](#usage)

### 1. Create your form request class by extending `InertiaFormRequest`

[](#1-create-your-form-request-class-by-extending-inertiaformrequest)

1. Create a RequestForm class and extend it from InertiaFormRequest
2. Create a static method named formInputs and return an instance of InertiaForm `UserFormRequest.php`

```
use Khodakhah\InertiaForm\InertiaFormRequest;

class UserFormRequest extends InertiaFormRequest
{
    public static function formInputs(\Khodakhah\InertiaForm\InertiaForm $form) : \Khodakhah\InertiaForm\InertiaForm{
        $form->text('name', 'required');
        $form->text('email', 'required|email');
        $form->text('password', 'required|min:8');
        return $form;
    }
}
```

3. Use `toInertia()` method to convert the form to an array and send it to the frontend. And use `validated()` method to convert the form errors to an array and send it to the frontend.

```
class UserController extends Controller
{
    use Khodakhah\InertiaForm\InertiaFormRequest;

    public function create()
    {
        return Inertia::render('User/Create', [
            'form' => UserFormRequest::toInertia()
        ]);
    }

    public function store(UserFormRequest $request)
    {
        User::create($request->validated());
        return redirect()->route('users.index');
    }
}
```

### 2. Create your form object simply by using `InertiaForm`

[](#2-create-your-form-object-simply-by-using-inertiaform)

You can simply create a form by using `InertiaForm` class, and assign it into a variable, or return it from a method.

```
class UserController extends Controller
{
    use Khodakhah\InertiaForm\InertiaForm;
    use Illuminate\Http\Request;

    private function userForm(): InertiaForm
    {
        $form = new InertiaForm();
        $form->text('name', 'required');
        $form->text('email', 'required|email');
        $form->text('password', 'required|min:8');
        return $form;
    }

    public function create()
    {
        return Inertia::render('User/Create', [
            'form' => $this->userForm()->toInertia()
        ]);
    }

    public function store(Request $request)
    {
        User::create(
            $request->validate(
                $this->userForm()->toValidation()
            )
        );
        return redirect()->route('users.index');
    }
}
```

Issues
------

[](#issues)

If you have any issues, please create an issue in the [issues section](https://github.com/khodakhah/laravel-inertia-form/issues).

Contributing
------------

[](#contributing)

If you have any ideas or suggestions, please create a pull request in the [pull requests section](https://github.com/khodakhah/laravel-inertia-form/pulls). I'll be happy to review and merge them.

### Local development

[](#local-development)

1. Clone the repository
2. Run `composer install`
3. Run `composer test` to run the tests
4. Run `composer pint` to run the linter (syntax check)
5. Run `composer fix` to fix the linter errors
6. Run `composer analyse` to run phpstan analyse

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 96.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

Unknown

Total

1

Last Release

983d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/14c33b2a5192b22bfae0610616692f75cd11d28cbfbca90268bdbbb850069c08?d=identicon)[khodakhah](/maintainers/khodakhah)

---

Top Contributors

[![khodakhah](https://avatars.githubusercontent.com/u/11370864?v=4)](https://github.com/khodakhah "khodakhah (27 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/khodakhah-laravel-inertia-form/health.svg)

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

###  Alternatives

[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[mrmarchone/laravel-auto-crud

Laravel Auto CRUD helps you streamline development and save time.

28711.8k2](/packages/mrmarchone-laravel-auto-crud)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

88103.7k](/packages/emargareten-inertia-modal)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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