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

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

webup/laravel-form
==================

A Laravel package to help build forms.

V1.10.0(2mo ago)147.2k↓33.3%4[1 PRs](https://github.com/agence-webup/laravel-form/pulls)1MITPHPPHP &gt;=5.3.0CI failing

Since Apr 13Pushed 2mo ago8 watchersCompare

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

READMEChangelog (1)Dependencies (6)Versions (21)Used By (1)

laravel-form
============

[](#laravel-form)

Install
-------

[](#install)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
$ composer require webup/laravel-form
```

### Step 2: Add the Service Provider

[](#step-2-add-the-service-provider)

Add this line to config/app.php:

```
'providers' => [
    //...
    Webup\LaravelForm\FormServiceProvider::class
]
```

### Step 3: Use Facade (optional)

[](#step-3-use-facade-optional)

For shorter code, you can use the facade by adding this line to config/app.php:

```
'aliases' => [
    //...
    'Form'      => Webup\LaravelForm\Facades\Form::class,
]
```

You can now use Laravel Form directly into your views (check some examples bellow)

### Step 4: Publish config

[](#step-4-publish-config)

You can publish config and override it in config/form.php:

```
 php artisan vendor:publish

```

Using
-----

[](#using)

### Methods

[](#methods)

These methods can be used with any type of elements:

- label($label = null, $escape = true)
- value($value = null)
- placeholder($placeholder = null)
- name($name = null)
- required($showStar = true)
- errors($errors = \[\])
- attr(array $attr = \[\])
- wrapperAttr(array $attr = \[\])
- wrapperClass($wrapperClass) **deprecated** use wrapperAttr(\['class' =&gt; 'myclass'\])

### Generated HTML

[](#generated-html)

```
{!! Form::create('text', 'name')
    ->label('Name')
    ->value('Barney')
    ->required()
    ->attr(['maxlenght' => '50'])
    ->wrapperAttr(['class' => 'f-custom-class']) !!}
```

Without errors:

```

    Name *

```

With errors (retrieve from Laravel validation):

```

    Name *

        Name is required

```

You can override default CSS class in config/form.php.

**Important**: Laravel Form can handle HTML generation and client side validation only. You need to manage server side validation on your own.

### Elements

[](#elements)

#### input

[](#input)

```
{!! Form::create('email', 'name')
    ->label('Email')
    ->value('homer.simpson@example.com')
    ->placeholder('example@adresse.com')
    ->required()
    ->wrapperAttr(['class' => 'custom-class']) !!}
```

#### textarea

[](#textarea)

```
{!! Form::create('textarea', 'name')
    ->label('Name')
    ->value('Nullam id dolor id nibh ultricies vehicula ut id elit.') !!}
```

#### radio

[](#radio)

```
{!! Form::create('radio', 'gender')->label('Gender')
    ->addRadio(1, 'Male', 'male')
    ->addRadio(0, 'Female', 'female')
    ->wrapperAttr(['class' => 'custom-class'])
    ->value(0) !!}
```

Specific methods :

- addRadio($value, $label, $id, $attr = \[\])

#### select

[](#select)

```
{!! Form::create('select', 'fruits')
    ->label("Fruits")
    ->placeholder("What's your favorite?")
    ->addOptions(['apple' => 'Apple', 'strawberry' => 'Strawberry', 'melon' => 'Melon'])
    ->value('apple') !!}
```

Specific methods :

- addOptions(array $options)

#### checkbox

[](#checkbox)

```
{!! Form::create('checkbox', 'cgu')
    ->label("I accept the general terms and conditions")
    ->value(true) !!}
```

You can use `->attr(['value' => '1'])` to change the value of the checkbox

AntiSpam feature
----------------

[](#antispam-feature)

### Honeypot

[](#honeypot)

```
{!! Form::honeypot("unicorn_mail") !!}
```

Will create an input `text` with `name='unicorn_mail'` within a hidden div (by javascript)

#### Validation

[](#validation)

```
$request->validate([
    [...]
    'unicorn_mail' => 'honeypot',
]);
```

### TimeTrap

[](#timetrap)

```
{!! Form::timetrap("unicorn_time") !!}
```

Will create an input `text` with `name='unicorn_time'` and `value="{encryptedTimestamp}"` within a hidden div (by javascript)

#### Validation

[](#validation-1)

```
$request->validate([
    [...]
    'unicorn_time' => 'timetrap:2',
]);
```

In this example, timetrap time is set to `2` seconds. If no value is set, config `form.antiSpam.minFormSubmitTime` is taken. Finally if config `form.antiSpam.minFormSubmitTime` is not set, default value is `3` seconds.

Styling
-------

[](#styling)

Bellow, you will find default styles that can work with Laravel Form.

```
.f-group {
  margin-bottom: 1rem;
}

.f-group label {
  margin-bottom: .5rem;
}

.f-required {
  color: #c0392b;
  font-weight: bold;
}

.f-error input {
  border: 1px solid #c0392b;
}

.f-error-message {
  margin-top: 4px;
  color: #c0392b;
}
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Credits
-------

[](#credits)

Developed by [Agence Webup](https://github.com/agence-webup)

License
-------

[](#license)

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

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance86

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~360 days

Total

19

Last Release

68d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/addc1cf5f44349ba20c55256d0fed71183ac31489031ae3210b9f3899f0e4f5b?d=identicon)[Agence Webup](/maintainers/Agence%20Webup)

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

---

Top Contributors

[![Biptaste](https://avatars.githubusercontent.com/u/251481?v=4)](https://github.com/Biptaste "Biptaste (29 commits)")[![robinparisi](https://avatars.githubusercontent.com/u/570975?v=4)](https://github.com/robinparisi "robinparisi (16 commits)")[![Byrby](https://avatars.githubusercontent.com/u/3066063?v=4)](https://github.com/Byrby "Byrby (11 commits)")[![TheOtix](https://avatars.githubusercontent.com/u/216242075?v=4)](https://github.com/TheOtix "TheOtix (2 commits)")[![vorban](https://avatars.githubusercontent.com/u/16322680?v=4)](https://github.com/vorban "vorban (2 commits)")[![TixieSalander](https://avatars.githubusercontent.com/u/2143796?v=4)](https://github.com/TixieSalander "TixieSalander (1 commits)")

---

Tags

formlaravellaravel-packagephplaravelformwebup

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravie/html

HTML and Form Builders for the Laravel Framework

36184.6k4](/packages/laravie-html)[tomjamon/laravel-custom-html

Custom HTML generator for Laravel (Based on LaravelCollective HTML)

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

An easy way to intergrate Twitter Bootstrap with Laravel.

232.7k](/packages/cornford-bootstrapper)

PHPackages © 2026

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