PHPackages                             activismebe/laravel-form-helpers - 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. [Database &amp; ORM](/categories/database)
4. /
5. activismebe/laravel-form-helpers

ActiveLibrary[Database &amp; ORM](/categories/database)

activismebe/laravel-form-helpers
================================

Handle form model binding, old input binding and validation error messages in a clean easy way.

1.2.0(8y ago)11.1k[3 issues](https://github.com/CPSB/Validation-helper/issues)MITPHPPHP &gt;=5.5.9

Since Sep 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/CPSB/Validation-helper)[ Packagist](https://packagist.org/packages/activismebe/laravel-form-helpers)[ RSS](/packages/activismebe-laravel-form-helpers/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Laravel Form Helpers
====================

[](#laravel-form-helpers)

A set of blade directives that automatically fill forms using the [old input](https://laravel.com/docs/5.5/requests#old-input)or an [Eloquent](https://laravel.com/docs/5.5/eloquent)model, it also helps you to display [validation error messages](https://laravel.com/docs/5.5/validation#working-with-error-messages)in a clean and easy way.

Example
-------

[](#example)

See how easy is to do cool stuff with these directives, for example if you are using [Bootstrap](https://getbootstrap.com) for your markup, you can do something like this:

```

    @form($model)

        @error('name')

```

And in the case of the user is redirected back with errors, the result will be:

```

        Error message

```

¡It's *awesame*!

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

[](#installation)

Install with composer, just run the command:

```
composer require sahibalejandro/laravel-form-helpers
```

Then add the service provider to your `config/app.php` file:

```
'providers' => [
    Sahib\Form\FormServiceProvider::class,
];
```

That's all.

Configuration
-------------

[](#configuration)

Optionally you can publish the configuration file with this command:

```
php artisan vendor:publish --provider=Sahib\Form\FormServiceProvider
```

After that you can edit the `config/form-helpers.php` file.

Usage
-----

[](#usage)

### @form

[](#form)

`@form([ Model $model = null ])`

Use the optional `@form` directive to bind a model to your form.
Ignore this directive if you just want the [old input](https://laravel.com/docs/5.2/requests#old-input) binding and no the model binding.

```

    @form($user)

```

### @input

[](#input)

`@input(string $attribute [, string $default = null ])`

Use the `@input` directive to assign the value to an input field:

```

```

This will result in the following markup:

```

```

### @text

[](#text)

`@text(string $attribute [, string $default = null ])`

Use the `@text` directive to assign the value to a textarea field:

```
@text('description')
@text('bio', 'Default')
```

This will result in the following markup:

```

Default
```

### @checkbox

[](#checkbox)

`@checkbox(string $attribute [, mixed $value = 1 [, boolean $checked = false ]])`

Use the `@checkbox` to set the value and the state of a checkbox:

```

```

This will result in the following markup:

```

```

### @radio

[](#radio)

`@radio(string $attribute [, mixed $value = 1 [, boolean $checked = false ]])`

The `@radio` directive is used in the same way as `@checkbox` directive, in fact is just an alias:

```

```

This will result in the following markup:

```

```

### @options

[](#options)

`@options(array $options, string $attribute [, mixed $default = null [, string $placeholder = null ]])`

Use the `@options` directive to display a list of options for a select field.

*Note: It also works with **select multiple** fields when the model's attribute, old input or `$default` value is an array.*

Let's say we pass an array named `$cardTypes` to the view and use it with the `@options`directive:

```
$cardTypes = [
    'VISA' => 'Visa',
    'MC'   => 'Master Card',
    'AME'  => 'American Express',
];
```

```

    @options($cardTypes, 'card_type')

```

This will result in the following markup:

```

    Visa
    Master Card
    American Express

```

Of course you can set a default selected option:

```

    @options($cardTypes, 'card_type', 'MC')

```

And the result will be:

```

    Visa
    Master Card
    American Express

```

Also you can define a *placeholder* option:

```

    @options($cardTypes, 'card_type', null, 'Select a card type')

```

The result will be:

```

    Select a card type
    Visa
    Master Card
    American Express

```

### @error

[](#error)

`@error(string $attribute [, string $template = null ])`

Use the `@error` directive to display a validation error message, this directive will check for you if the error exists or not.

```

@error('name')
```

Then when the user is redirected back with errors, the result will be:

```

The name field fails validation.
```

Note that the `@error` directive is [Bootstrap](https://getbootstrap.com) friendly by default, but you can define a custom template inline or in the config file:

```
@error('name', ':message')
```

And the result will be:

```
Error message
```

See how easy is to do cool stuff with `@error` directive, for example if you are using [Bootstrap](https://getbootstrap.com) for your markup, you can do something like this:

```

    @error('name')

```

And in the case the user is redirected back with errors, the result will be:

```

    Error message

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~38 days

Total

3

Last Release

3098d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5157609?v=4)[Tim Joosten](/maintainers/Tjoosten)[@Tjoosten](https://github.com/Tjoosten)

---

Top Contributors

[![Tjoosten](https://avatars.githubusercontent.com/u/5157609?v=4)](https://github.com/Tjoosten "Tjoosten (10 commits)")

---

Tags

laravelvalidationhelpershtmleloquentsessionforminput

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

15828.6k](/packages/relaticle-custom-fields)[mvanduijker/laravel-model-exists-rule

Validation rule to check if a model exists

22194.5k1](/packages/mvanduijker-laravel-model-exists-rule)[mnabialek/laravel-eloquent-filter

Allows filtering Eloquent queries by input filters

2614.5k](/packages/mnabialek-laravel-eloquent-filter)

PHPackages © 2026

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