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

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

intentor/laravel-form
=====================

Form helpers for Laravel 5.

v2.0(10y ago)108353MITHTMLPHP &gt;=5.4.0CI failing

Since Mar 12Pushed 6y ago2 watchersCompare

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

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

[![Laravel Form](https://cloud.githubusercontent.com/assets/5340818/6645463/9c9d47f6-c99b-11e4-98ef-1cc82c7364d0.png)](https://cloud.githubusercontent.com/assets/5340818/6645463/9c9d47f6-c99b-11e4-98ef-1cc82c7364d0.png)
===========================================================================================================================================================================================================================

[](#)

**Form helpers for Laravel 5**

Currently the project is **DISCONTINUED**. However, feel free to fork it and continue its development!

Contents
--------

[](#contents)

1. [Introduction](#introduction)
2. [Installation](#installation)
3. [Quick start](#quick-start)
4. [Helpers](#helpers)
    - [open](#form-open)
    - [model](#form-model)
    - [close](#form-close)
    - [label](#form-label)
    - [readonly](#form-readonly)
    - [hidden](#form-hidden)
    - [text](#form-text)
    - [textarea](#form-textarea)
    - [email](#form-email)
    - [url](#form-url)
    - [number](#form-number)
    - [password](#form-password)
    - [checkbox](#form-checkbox)
    - [radio](#form-radio)
    - [checkboxGroup](#form-checkboxGroup)
    - [radioGroup](#form-radioGroup)
    - [dropdown](#form-dropdown)
    - [submit](#form-submit)
    - [reset](#form-reset)
    - [buttons](#form-buttons)
5. [Utilities](#utilities)
    - [modelToList](#form-modelToList)
    - [modelToSelected](#form-modelToSelected)
6. [Themes](#themes)
7. [Changelog](#changelog)
8. [Support](#support)
9. [License](#license)

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

[](#introduction)

*Laravel Form* provides a series of helpers for form creation in PHP pages and Blade templates.

Compatible with Laravel 5.

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

[](#installation)

### Laravel 5.0

[](#laravel-50)

At `composer.json` of your Laravel installation, add the following require line:

```
{
    "require": {
        "intentor/laravel-form": "~1.0"
    }
}
```

Run `composer update` to add the package to your Laravel app.

At `config/app.php`, add the Service Provider and the Facade:

```
    'providers' => [
		'Intentor\LaravelForm\ServiceProvider',
    ]

	//...

    'aliases' => [
        'Form' => 'Intentor\LaravelForm\Facade'
    ]
```

### Laravel 5.1+

[](#laravel-51)

At `composer.json` of your Laravel installation, add the following require line:

```
{
    "require": {
        "intentor/laravel-form": "~2.0"
    }
}
```

Run `composer update` to add the package to your Laravel app.

At `config/app.php`, add the Service Provider and the Facade:

```
    'providers' => [
        Intentor\LaravelForm\ServiceProvider::class,
    ]

    //...

    'aliases' => [
        'Form' => Intentor\LaravelForm\Facade::class,
    ]
```

Quick start
------------------------------------------------

[](#quick-start)

To create a form, you can user either Blade helpers or the `Form` Facade.

Using Blade helpers:

```
@form_open(action('SomeController@action'))

@form_close
```

Using Facades:

```
{!! Form::open(action('SomeController@action')) !!}

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

Any controls you want to create must be placed between the opening and closing of the form.

Using Blade helpers:

```
@form_open(action('SomeController@action'))

@form_text('name', 'Name')

@form_buttons('Send', 'Reset')

@form_close
```

Using Facades:

```
{!! Form::open(action('SomeController@action')) !!}

{!! Form::text('name', 'Name') !!}

{!! Form::buttons('Send', 'Reset') !!}

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

Helpers
----------------------------------------

[](#helpers)

### open

[](#open)

Opens a form. See [Themes](#themes) for more details on form themes.

#### Blade helper

[](#blade-helper)

```
@form_open($url, $method = 'POST', $theme = null, $includeCsrfToken = true, $attributes = [])
```

#### Facade

[](#facade)

```
{!! Form::open($url, $method = 'POST', $theme = null, $includeCsrfToken = true, $attributes = []) !!}
```

#### Parameters

[](#parameters)

- string `$url` Action URL.
- string `$method` Form method.
- bool `$theme` Controls' theme. It's a subfolder on the partials.form folder.
- bool `$includeCsrfToken` Indicates whether the CSRF token should be included.
- array `$attributes` Form attributes.

### model

[](#model)

Opens a form for a model. See [Themes](#themes) for more details on form themes.

#### Blade helper

[](#blade-helper-1)

```
@form_
```

#### Facade

[](#facade-1)

```
{!! Form::model($model, $url, $method = 'POST', $theme = null, $includeCsrfToken = true, $attributes = []) !!}
```

#### Parameters

[](#parameters-1)

- object `$model` Model object.
- string `$url` Action URL.
- string `$method` Form method.
- bool `$theme` Controls' theme. It's a subfolder on the partials.form folder.
- bool `$includeCsrfToken` Indicates whether the CSRF token should be included.
- array `$attributes` Form attributes.

### close

[](#close)

Closes a from.

#### Blade helper

[](#blade-helper-2)

```
@form_close
```

#### Facade

[](#facade-2)

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

#### Parameters

[](#parameters-2)

None.

### label

[](#label)

Creates a label.

#### Blade helper

[](#blade-helper-3)

```
@form_label($text, $field = null, $attributes = [])
```

#### Facade

[](#facade-3)

```
{!! Form::label($text, $field = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-3)

- string `$text` Label text.
- string `$field` Related field name.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### readonly

[](#readonly)

Creates a readonly control.

#### Blade helper

[](#blade-helper-4)

```
@form_readonly($label, $text, $attributes = [])
```

#### Facade

[](#facade-4)

```
{!! Form::readonly($label, $text, $attributes = []) !!}
```

#### Parameters

[](#parameters-4)

- string `$label` Label text.
- string `$text` Field text.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### hidden

[](#hidden)

Creates a hidden field.

#### Blade helper

[](#blade-helper-5)

```
@form_hidden($name, $value = null, $attributes = [])
```

#### Facade

[](#facade-5)

```
{!! Form::hidden($name, $value = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-5)

- string `$name` Field name.
- string `$value` Field value.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### text

[](#text)

Creates a text field.

#### Blade helper

[](#blade-helper-6)

```
@form_text($name, $label = null, $attributes = [])
```

#### Facade

[](#facade-6)

```
{!! Form::text($name, $label = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-6)

- string `$name` Field name.
- string `$label` Field label.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### textarea

[](#textarea)

Creates a textarea field.

#### Blade helper

[](#blade-helper-7)

```
@form_textarea($name, $label = null, $attributes = [])
```

#### Facade

[](#facade-7)

```
{!! Form::textarea($name, $label = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-7)

- string `$name` Field name.
- string `$label` Field label.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### email

[](#email)

Creates an e-mail field.

#### Blade helper

[](#blade-helper-8)

```
@form_email($name, $label = null, $attributes = [])
```

#### Facade

[](#facade-8)

```
{!! Form::email($name, $label = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-8)

- string `$name` Field name.
- string `$label` Field label.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### url

[](#url)

Creates an URL field.

#### Blade helper

[](#blade-helper-9)

```
@form_url($name, $label = null, $attributes = [])
```

#### Facade

[](#facade-9)

```
{!! Form::url($name, $label = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-9)

- string `$name` Field name.
- string `$label` Field label.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### number

[](#number)

Creates a number field.

#### Blade helper

[](#blade-helper-10)

```
@form_number($name, $label = null, $min = 0, $max = 9999, $step = 1, $attributes = [])
```

#### Facade

[](#facade-10)

```
{!! Form::number($name, $label = null, $min = 0, $max = 9999, $step = 1, $attributes = []) !!}
```

#### Parameters

[](#parameters-10)

- string `$name` Field name.
- string `$label` Field label.
- int `$min` Minimum number.
- int `$max` Maximum number.
- int `$step` Combined with the min value, defines the acceptable numbers in the range.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### password

[](#password)

Creates a password field.

#### Blade helper

[](#blade-helper-11)

```
@form_password($name, $label = null, $attributes = [])
```

#### Facade

[](#facade-11)

```
{!! Form::password($name, $label = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-11)

- string `$name` Field name.
- string `$label` Field label.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### checkbox

[](#checkbox)

Creates a checkbox field.

#### Blade helper

[](#blade-helper-12)

```
@form_checkbox($name, $label = null, $value = 1, $attributes = [])
```

#### Facade

[](#facade-12)

```
{!! Form::checkbox($name, $label = null, $value = 1, $attributes = []) !!}
```

#### Parameters

[](#parameters-12)

- string `$name` Field name.
- string `$label` Field label.
- string `$value` Field value.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### radio

[](#radio)

Creates a radio field.

#### Blade helper

[](#blade-helper-13)

```
@form_radio($name, $label = null, $attributes = [])
```

#### Facade

[](#facade-13)

```
{!! Form::radio($name, $label = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-13)

- string `$name` Field name.
- string `$label` Field label.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### checkboxGroup

[](#checkboxgroup)

Creates a checkbox group.

#### Blade helper

[](#blade-helper-14)

```
@form_checkbox_group($name, $label = null, $list = [], $selected = [], $attributes = [])
```

#### Facade

[](#facade-14)

```
{!! Form::checkboxGroup($name, $label = null, $list = [], $selected = [], $attributes = []) !!}
```

#### Parameters

[](#parameters-14)

- string `$name` Field name.
- string `$label` Field label.
- array `$list` Item's list. Format: \[ 'value' =&gt; '', 'text' =&gt; '' \]. Use [modelToList](#form-modelToList) to generate a list from models.
- array `$selected` Selected values. Format: \[ 'value', 'value', ... \]. Use [modelToSelected](#form-modelToSelected) to generate values from models.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### radioGroup

[](#radiogroup)

Creates a radio group.

#### Blade helper

[](#blade-helper-15)

```
@form_radio_group($name, $label = null, $list = [], $selected = null, $attributes = [])
```

#### Facade

[](#facade-15)

```
{!! Form::radioGroup($name, $label = null, $list = [], $selected = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-15)

- string `$name` Field name.
- string `$label` Field label.
- array `$list` Item's list. Format: \[ 'value' =&gt; '', 'text' =&gt; '' \]. Use [modelToList](#form-modelToList) to generate a list from models.
- string `$selected` Selected value.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### dropdown

[](#dropdown)

Creates a dropdown field.

#### Blade helper

[](#blade-helper-16)

```
@form_dropdown($name, $label = null, $list = [], $empty = null, $selected = null, $attributes = [])
```

#### Facade

[](#facade-16)

```
{!! Form::dropdown($name, $label = null, $list = [], $empty = null, $selected = null, $attributes = []) !!}
```

#### Parameters

[](#parameters-16)

- string `$name` Field name.
- string `$label` Field label.
- array `$list` Item's list. Format: \[ 'value' =&gt; 'text', 'text' =&gt; '' \]. Use [modelToList](#form-modelToList) to generate a list from models.
- string `$empty` Empty value text. If no text is provided, there will not be an empty option.
- string `$selected` Selected value.
- array `$attributes` Element attributes. Format: \[ 'attribute' =&gt; 'value' \].

### submit

[](#submit)

Creates a submit button.

#### Blade helper

[](#blade-helper-17)

```
@form_submit($label)
```

#### Facade

[](#facade-17)

```
{!! Form::submit($label) !!}
```

#### Parameters

[](#parameters-17)

- string `$label` Control label.

### reset

[](#reset)

Creates a reset button.

#### Blade helper

[](#blade-helper-18)

```
@form_reset($label)
```

#### Facade

[](#facade-18)

```
{!! Form::reset($label) !!}
```

#### Parameters

[](#parameters-18)

- string `$label` Control label.

### buttons

[](#buttons)

Creates form buttons (submit and reset).

#### Blade helper

[](#blade-helper-19)

```
@form_buttons($submitLabel, $resetLabel = null)
```

#### Facade

[](#facade-19)

```
{!! Form::buttons($submitLabel, $resetLabel = null) !!}
```

#### Parameters

[](#parameters-19)

- string `$submitLabel` Submit button label.
- string `$resetLabel` Reset button label. If no label is given, the button is not created.

Utilities
--------------------------------------------

[](#utilities)

### modelToList

[](#modeltolist)

Generates an array compatible with lists (dropdowns, checkbox groups, etc.).

#### Facade

[](#facade-20)

```
Form::modelToList($model, $valueField, $textField)
```

#### Parameters

[](#parameters-20)

- object `$model` Model to be converted.
- string `$valueField` Field on data that is the value.
- string `$textField` Field on data that is the text.

### modelToSelected

[](#modeltoselected)

Generates an array of selected values.

#### Facade

[](#facade-21)

```
Form::modelToSelected($model, $valueField)
```

#### Parameters

[](#parameters-21)

- object `$model` Model to be converted.
- string `$valueField` Field on data that is the value.

Themes
--------------------------------------

[](#themes)

Themes are a way to customize the look of forms using partial views.

### Available themes

[](#available-themes)

There are three different themes available:

1. **default**: a simple form theme without any third party dependencies.
2. **horizontal**: default [Bootstrap horizontal](http://getbootstrap.com/css/#forms-horizontal) form (Requires [Bootstrap 3](http://getbootstrap.com/)).
3. **vertical**: default [Bootstrap vertical](http://getbootstrap.com/css/#forms-example) form (Requires [Bootstrap 3](http://getbootstrap.com/)).

All themes are subfolders at `src/resources/views/partials/form` folder.

### Creating a custom theme

[](#creating-a-custom-theme)

To create a custom theme, copy a base theme from `vendor/intentor/laravel-form/src/resources/views/partials/form` at your local Laravel installation to the `resources/views/partials/form` of your app.

Each helper has its own Blade template file, which can then be customized.

**Note**: the name of the theme's folder is the name that must be used when [setting the theme](#form-open).

Changelog
--------------------------------------------

[](#changelog)

Please see [CHANGELOG.md](CHANGELOG.md).

Support
----------------------------------------

[](#support)

Found a bug? Please create an issue on the [GitHub project page](https://github.com/intentor/laravel-form/issues) or send a pull request if you have a fix or extension.

You can also send me a message at  to discuss more obscure matters about the component.

License
----------------------------------------

[](#license)

Licensed under the [The MIT License (MIT)](http://opensource.org/licenses/MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 94.1% 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 ~42 days

Total

5

Last Release

3909d ago

Major Versions

v1.1.2 → v2.02015-08-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f638c343495bedb85144e5905d74d322747f5873c36d0edbacb157b4fc8b639?d=identicon)[Intentor](/maintainers/Intentor)

---

Top Contributors

[![intentor](https://avatars.githubusercontent.com/u/5340818?v=4)](https://github.com/intentor "intentor (32 commits)")[![tkaravou](https://avatars.githubusercontent.com/u/714034?v=4)](https://github.com/tkaravou "tkaravou (2 commits)")

---

Tags

discontinuedlavavelphppluginhelperhtmllaravel 5form

### Embed Badge

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

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

###  Alternatives

[aura/html

Provides HTML escapers and helpers, including form input helpers.

52270.5k21](/packages/aura-html)[arcanedev/php-html

A simple way to create html tags with php.

16994.8k6](/packages/arcanedev-php-html)[orchestra/html

HTML Component for Orchestra Platform

40112.6k2](/packages/orchestra-html)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[okipa/laravel-form-components

Ready-to-use and customizable form components.

198.0k1](/packages/okipa-laravel-form-components)

PHPackages © 2026

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