PHPackages                             souravmsh/laravel-html - 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. [Templating &amp; Views](/categories/templating)
4. /
5. souravmsh/laravel-html

ActiveLibrary[Templating &amp; Views](/categories/templating)

souravmsh/laravel-html
======================

HTML and Form Builders for Laravel

v1.0.0(1mo ago)016MITPHPPHP ^8.1

Since Apr 14Pushed 1mo agoCompare

[ Source](https://github.com/souravmsh/laravel-html)[ Packagist](https://packagist.org/packages/souravmsh/laravel-html)[ RSS](/packages/souravmsh-laravel-html/feed)WikiDiscussions main Synced 1w ago

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

Laravel HTML Form
=================

[](#laravel-html-form)

A lightweight HTML and Form Builders library for Laravel.

Motivation &amp; History
------------------------

[](#motivation--history)

For years, the `laravelcollective/html` package was standard for managing forms and HTML in Laravel applications. However, as Laravel progressed into newer major releases, the `laravelcollective/html` package was deprecated and stopped receiving support.

This presented a significant upgrade hurdle: legacy codebases with hundreds of forms utilizing the `Form::` facade would require massive refactoring efforts just to upgrade the core Laravel framework.

**Laravel HTML Form** was built to solve this exact problem. It serves as a custom, lightweight, drop-in replacement that precisely mimics the API and core features of the original `laravelcollective/html` package. By simply installing this library, you can safely upgrade your project to modern Laravel versions without needing to rewrite a single line of your existing Blade templates!

Features
--------

[](#features)

- Seamless drop-in replacement for legacy syntax
- Compatible with Laravel 10.x, 11.x, 12.x and 13.x
- Automatic CSRF Token injection
- Automatic method spoofing (`PUT`, `PATCH`, `DELETE`)
- Form Model Binding (including nested `dot.notation` elements)
- Supports repopulating with `old()` session inputs

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

[](#installation)

```
composer require souravmsh/laravel-html
```

Quick Start
-----------

[](#quick-start)

This package provides the `Form` facade which allows you to build HTML forms easily.

Opening a Form
--------------

[](#opening-a-form)

```
{!! Form::open(['url' => 'foo/bar']) !!}
    //
{!! Form::close() !!}
```

**Using Named Routes:**

```
{!! Form::open(['route' => 'route.name']) !!}
```

**Using Controller Actions:**

```
{!! Form::open(['action' => 'Controller@method']) !!}
```

**Specifying the Method:**By default, forms using the `open` method will use `POST`. You can customize this:

```
{!! Form::open(['url' => 'foo/bar', 'method' => 'put']) !!}
```

> **Note:** Since HTML forms only support `POST` and `GET`, `PUT`, `PATCH` and `DELETE` will be spoofed by automatically adding a `_method` hidden field to your form.

**File Uploads:**If your form includes file uploads, add a `files` option:

```
{!! Form::open(['url' => 'foo/bar', 'files' => true]) !!}
```

Model Binding
-------------

[](#model-binding)

You can populate forms automatically using model binding. It automatically gets values from `old()` session inputs and falls back to attributes of your model instance. It also supports dot notation formatting for array inputs like `address.city`.

```
{!! Form::model($user, ['route' => ['user.update', $user->id], 'method' => 'put']) !!}
    {!! Form::text('name') !!}
{!! Form::close() !!}
```

Labels &amp; Inputs
-------------------

[](#labels--inputs)

### Labels

[](#labels)

```
{!! Form::label('email', 'E-Mail Address', ['class' => 'control-label']) !!}
```

### Text, Email &amp; Password

[](#text-email--password)

```
{!! Form::text('username', null, ['class' => 'form-control']) !!}
{!! Form::email('email', null, ['class' => 'form-control']) !!}
{!! Form::password('password', ['class' => 'form-control']) !!}
```

*Note: Password inputs do not prepopulate from old input or model binding.*

### Other Inputs

[](#other-inputs)

```
{!! Form::number('age', null, ['class' => 'form-control']) !!}
{!! Form::date('birthdate', null, ['class' => 'form-control']) !!}
{!! Form::url('website_url', null, ['class' => 'form-control']) !!}
{!! Form::hidden('invisible', 'secret') !!}
```

### Textarea

[](#textarea)

```
{!! Form::textarea('description', null, ['class' => 'form-control', 'rows' => 3]) !!}
```

### File Uploads

[](#file-uploads)

```
{!! Form::file('avatar', ['class' => 'form-control-file']) !!}
```

### Checkboxes and Radio Buttons

[](#checkboxes-and-radio-buttons)

```
{!! Form::checkbox('name', 'value', true) !!}
{!! Form::radio('name', 'value', true) !!}
```

### Dropdown Lists (Select)

[](#dropdown-lists-select)

You may pass an array (or a collection) into the select method:

```
{!! Form::select('size', ['L' => 'Large', 'S' => 'Small'], 'S', ['placeholder' => 'Select a size']) !!}
```

**Grouped Lists:**

```
{!! Form::select('animal', [
    'Cats' => ['leopard' => 'Leopard'],
    'Dogs' => ['spaniel' => 'Spaniel'],
], null) !!}
```

### Buttons

[](#buttons)

```
{!! Form::submit('Submit Now', ['class' => 'btn btn-primary']) !!}
{!! Form::button('Click Me', ['class' => 'btn btn-secondary', 'type' => 'button']) !!}
```

Helper Functions
----------------

[](#helper-functions)

In addition to the `Form` facade, this package also provides a `form()` global helper function. This is especially useful if you prefer function-based syntax over static facade method calls.

```
{!! form()->open(['url' => 'foo/bar']) !!}
    {!! form()->text('name', null, ['class' => 'form-control']) !!}
{!! form()->close() !!}
```

Extending / Macros
------------------

[](#extending--macros)

Since the underlying `FormBuilder` uses the `Macroable` trait, you can easily register your own custom methods:

```
Form::macro('myField', function() {
    return '';
});
```

Then use it via:

```
{!! Form::myField() !!}
```

License
-------

[](#license)

This package is open-source software licensed under the MIT license.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance89

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

56d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12506579?v=4)[Shohrab Hossain](/maintainers/souravmsh)[@souravmsh](https://github.com/souravmsh)

---

Top Contributors

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

---

Tags

laravelhtmlbuilderformcontacthtml-formsouravmshcodekernel

### Embed Badge

![Health badge](/badges/souravmsh-laravel-html/health.svg)

```
[![Health](https://phpackages.com/badges/souravmsh-laravel-html/health.svg)](https://phpackages.com/packages/souravmsh-laravel-html)
```

###  Alternatives

[moonshine/moonshine

Laravel administration panel

1.3k239.9k72](/packages/moonshine-moonshine)[laravie/html

HTML and Form Builders for the Laravel Framework

36185.1k4](/packages/laravie-html)[ublabs/blade-simple-icons

A package to easily make use of Simple Icons in your Laravel Blade views.

1958.8k](/packages/ublabs-blade-simple-icons)[technikermathe/blade-lucide-icons

A package to easily make use of Lucide icons in your Laravel Blade views.

18379.7k9](/packages/technikermathe-blade-lucide-icons)[vluzrmos/collective-html

LaravelCollective Html and Form builder for Lumen.

2523.9k](/packages/vluzrmos-collective-html)[tomjamon/laravel-custom-html

Custom HTML generator for Laravel (Based on LaravelCollective HTML)

1018.6k](/packages/tomjamon-laravel-custom-html)

PHPackages © 2026

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