PHPackages                             imansugirman/laravel-customui-forms - 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. imansugirman/laravel-customui-forms

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

imansugirman/laravel-customui-forms
===================================

Custom UI from Forked NetoJose Form Bootstrap 4 Builder for Laravel 5

03PHP

Since May 14Pushed 6y agoCompare

[ Source](https://github.com/imansugirman/laravel-customui-form)[ Packagist](https://packagist.org/packages/imansugirman/laravel-customui-forms)[ RSS](/packages/imansugirman-laravel-customui-forms/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Bootstrap 4 forms for Laravel 5
===============================

[](#bootstrap-4-forms-for-laravel-5)

This is a package for creating Bootstrap 4 styled form elements in Laravel 5.

Features
--------

[](#features)

- Labels
- Error messages
- Bootstrap 4 markup and classes (including state, colors, and sizes)
- Error validation messages
- Form fill (using Model instance, array or after form submission when a validation error occurs)
- Internationalization
- Add parameters using php chaining approach
- Zero dependences (no Laravel Collective dependency)

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

[](#introduction)

### Before

[](#before)

```

    Username

    @if($errors->has('username'))
    {{$errors->first('username')}}
    @endif

```

### After

[](#after)

```
Form::text('username', 'Username')
```

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

[](#installation)

#### Require the package using Composer.

[](#require-the-package-using-composer)

```
composer require netojose/laravel-bootstrap-4-forms
```

### Laravel 5.5 or above

[](#laravel-55-or-above)

If you is using Laravel 5.5, the auto discovery feature will make everything for you and your job is done, you can start using now. Else, follow the steps below to install.

### Laravel 5.4

[](#laravel-54)

#### Add the service provider to your config/app.php file

[](#add-the-service-provider-to-your-configappphp-file)

```
'providers' => [
    //...
	NetoJose\Bootstrap4Forms\Bootstrap4FormsServiceProvider::class,
],
```

#### Add the BootForm facade to the aliases array in config/app.php:

[](#add-the-bootform-facade-to-the-aliases-array-in-configappphp)

```
'aliases' => [
    //...
    'Form' => NetoJose\Bootstrap4Forms\Bootstrap4FormsFacade::class,
],
```

Usage
-----

[](#usage)

### Basic form controls

[](#basic-form-controls)

#### Opening and closing a form

[](#opening-and-closing-a-form)

```
// Opening a form using POST method

{!!Form::open()!!}
// ... Form components here
{!!Form::close()!!}
```

> Opening the form will add \_token field automatically for you

#### Inline form

[](#inline-form)

```
// Making all inputs inline
{!!Form::inlineForm()!!}
```

#### Fieldset

[](#fieldset)

ParamTypeDefaultDescription$legendstringnullFieldset Legend```
// Example
{!!Form::fieldsetOpen('Legend title')!!}
// ... fieldset content
{!!Form::fieldsetClose()!!}
```

### Basic inputs

[](#basic-inputs)

#### Text inputs

[](#text-inputs)

ParamTypeDefaultDescription$namestringnullInput name$labelstringnullInput label$defaultstringnullDefault value```
// Example
{!!Form::text('name', 'User name')!!}
```

##### Textarea

[](#textarea)

ParamTypeDefaultDescription$namestringnullInput name$labelstringnullInput label$defaultstringnullDefault value```
// Example
{!!Form::textarea('description', 'Description')!!}
```

##### Select

[](#select)

ParamTypeDefaultDescription$namestringnullInput name$labelstringnullInput label$optionsarray\[\]Select options$defaultstringnullDefault value```
// Example
{!!Form::select('city', 'Choose your city', [1 => 'Gotham City', 2 => 'Springfield'])!!}
```

#### Select Default Value

[](#select-default-value)

```
{!!Form::select('city', 'Choose your city', [''=>'--choose your city---',1 => 'Gotham City', 2 => 'Springfield'])!!}
```

##### Checkbox

[](#checkbox)

ParamTypeDefaultDescription$namestringnullInput name$labelstringnullInput label$valuestringnullInput value$defaultbooleannullDefault value```
// Example
{!!Form::checkbox('orange', 'Orange')!!}
```

##### Radio

[](#radio)

ParamTypeDefaultDescription$namestringnullInput name$labelstringnullInput label$valuestringnullInput value$defaultbooleannullDefault value```
// Example
{!!Form::radio('orange', 'Orange')!!}
```

##### File

[](#file)

ParamTypeDefaultDescription$namestringnullInput name$labelstringnullInput label```
// Example
{!!Form::file('doc', 'Document')!!}
```

#### Date inputs

[](#date-inputs)

ParamTypeDefaultDescription$namestringnullInput name$labelstringnullInput label$defaultstringnullDefault value```
// Example
{!!Form::date('birthday', 'Birthday')!!}
```

#### Time inputs

[](#time-inputs)

ParamTypeDefaultDescription$namestringnullInput name$labelstringnullInput label$defaultstringnullDefault value```
// Example
{!!Form::time('hour', 'Meeting hour')!!}
```

#### Range inputs

[](#range-inputs)

ParamTypeDefaultDescription$namestringnullInput name$labelstringnullInput label$defaultstringnullDefault value```
// Example
{!!Form::range('name', 'User name')!!}
```

##### Hidden

[](#hidden)

ParamTypeDefaultDescription$namestringnullInput name$defaultbooleannullDefault value```
// Example
{!!Form::hidden('user_id')!!}
```

##### Anchor

[](#anchor)

ParamTypeDefaultDescription$valuestringnullAnchor text$urlstringnullAnchor url```
// Example
{!!Form::anchor("Link via parameter", 'foo/bar')!!}
```

##### Buttons

[](#buttons)

ParamTypeDefaultDescription$valuestringnullButton value$colorstringnullButton color$sizestringnullbutton size###### Submit

[](#submit)

```
// Example
{!!Form::submit("Send form")!!}
```

###### Button

[](#button)

```
// Example
{!!Form::button("Do something", "warning", "lg")!!}
```

###### Reset

[](#reset)

```
// Example
{!!Form::reset("Clear form")!!}
```

### Chainable methods

[](#chainable-methods)

> This package uses [chaining](https://en.wikipedia.org/wiki/Method_chaining) feature, allowing easly pass more parameters.

### Filling a form

[](#filling-a-form)

ParamTypeDefaultDescription$dataobjectarraynull```
// Examples

// With initial data using a Model instance
$user = User::find(1);
{!!Form::open()->fill($user)!!}

// With initial array data
$user = ['name' => 'Jesus', 'age' => 33];
{!!Form::open()->fill($user)!!}
```

### Url

[](#url)

Use in anchors and forms openings

ParamTypeDefaultDescription$urlstringnullUrl```
// Example
{!!Form::anchor("Link via url")->url('foo/bar')!!}
```

### Route

[](#route)

Use in anchors and forms openings

ParamTypeDefaultDescription$routestringnullRoute name```
// Example
{!!Form::anchor("Link via route")->route('home')!!}
```

### Checked

[](#checked)

Set the checkbox/radio checked status

ParamTypeDefaultDescription$checkedbooleantrueChecked status```
// Examples

// Using readonly field
{!!Form::checkbox('agree', 'I agree')->checked()!!}

// You can use FALSE to turn off checked status
{!!Form::checkbox('agree', 'I agree')->checked(false)!!}
```

### Inline

[](#inline)

Set the checkbox/radio checked status

```
// Examples
{!!Form::radio('orange', 'Orange')->inline()!!}

{!!Form::checkbox('orange', 'Orange')->inline()!!}
```

### Placeholder

[](#placeholder)

ParamTypeDefaultDescription$placeholderstringnullPlaceholder text```
// Example
{!!Form::text('name', 'Name')->placeholder('Input placeholder')!!}
```

### Select Multiple

[](#select-multiple)

```
// Example
{!!Form::select('city', 'Choose your city', [1 => 'Gotham City', 2 => 'Springfield'])->multiple()!!}
```

### Locale

[](#locale)

Using locale, the package will look for a resources/lang/{CURRENT\_LANG}/forms/user.php language file and uses labels and help texts as keys for replace texts

```
// Example
{!!Form::open()->locale('forms.user')!!}
```

### Help Text

[](#help-text)

ParamTypeDefaultDescription$textstringnullHelp text```
// Example
{!!Form::text('name', 'Name')->help('Help text here')!!}
```

### Custom attributes

[](#custom-attributes)

ParamTypeDefaultDescription$attrsarray\[\]Custom input attributes```
// Example
{!!Form::text('name', 'Name')->attrs(['data-foo' => 'bar', 'rel'=> 'baz'])!!}
```

### Custom attributes in wrapper div (&lt;div class="form-group"&gt;...&lt;/div&gt;)

[](#custom-attributes-in-wrapper-div-div-classform-groupdiv)

ParamTypeDefaultDescription$attrsarray\[\]Custom input attributes```
// Example
{!!Form::text('name', 'Name')->wrapperAttrs(['data-foo' => 'bar', 'id'=> 'name-wrapper'])!!}
```

### Readonly

[](#readonly)

ParamTypeDefaultDescription$statusbooleantrueRead only status```
// Examples

// Using readonly field
{!!Form::text('name', 'Name')->readonly()!!}

// You can use FALSE to turn off readonly status
{!!Form::text('name', 'Name')->readonly(false)!!}
```

### Disabled

[](#disabled)

ParamTypeDefaultDescription$statusbooleantrueDisabled status```
// Examples

// Disabling a field
{!!Form::text('name', 'Name')->disabled()!!}

// Disabling a fieldset
{!!Form::fieldsetOpen('User data')->disabled()!!}

// You can use FALSE to turn off disabled status
{!!Form::text('name', 'Name')->disabled(false)!!}
```

### Block

[](#block)

ParamTypeDefaultDescription$statusbooleantrueDisabled status```
// Examples

// Disabling a field
{!!Form::text('name', 'Name')->block()!!}

// You can use FALSE to turn off block status
{!!Form::text('name', 'Name')->block(false)!!}
```

### Required

[](#required)

ParamTypeDefaultDescription$statusbooleantrueRequired status```
// Examples

// Disabling a field
{!!Form::text('name', 'Name')->required()!!}

// Disabling a fieldset
{!!Form::fieldsetOpen('User data')->required()!!}

// You can use FALSE to turn off required status
{!!Form::text('name', 'Name')->required(false)!!}
```

### AutoFill

[](#autofill)

ParamTypeDefaultDescription$valuestring'on'autocomplte valuesee:

If no autocomplete value is specified on the form, html spec requires a default value of 'on'. So, you must explicitly turn it off.

Autocomplete values will be automatically generated for fields with single word names matching valid values (e.g. name, email, tel, organization). The complete list is in the spec mentioned above.

```
// Examples

// Switch off autocomplete for the form
{!!Form::open()->autocomplete('off')!!}

// Explicitly set a autocomplete value
{!!Form::text('mobile', 'Mobile Number')->autocomplete('tel')!!}

// Disable autocomplete for fields with valid names
{!!Form::text('name', 'Name')->autocomplete('off')!!}
```

### Id

[](#id)

ParamTypeDefaultDescription$idstringnullId field```
// Example
{!!Form::text('name', 'Name')->id('user-name')!!}
```

### Id prefix

[](#id-prefix)

ParamTypeDefaultDescription$prefixstringnullId prefix```
// Example
{!!Form::open()->idPrefix('register')!!}
```

### Multipart

[](#multipart)

ParamTypeDefaultDescription$multipartbooleantrueMultipart flag```
// Examples
{!!Form::open()->multipart()!!}

// You can use FALSE to turn off multipart
{!!Form::open()->multipart(false)!!}
```

### Method

[](#method)

ParamTypeDefaultDescription$methodstringnullHTTP method```
// Examples
{!!Form::open()->method('get')!!}
{!!Form::open()->method('post')!!}
{!!Form::open()->method('put')!!}
{!!Form::open()->method('patch')!!}
{!!Form::open()->method('delete')!!}
```

### explicit HTTP verbs

[](#explicit-http-verbs)

```
// Examples
{!!Form::open()->get()!!}
{!!Form::open()->post()!!}
{!!Form::open()->put()!!}
{!!Form::open()->patch()!!}
{!!Form::open()->delete()!!}
```

### Color

[](#color)

ParamTypeDefaultDescription$colorstringnullColor name```
// Examples
{!!Form::button("Do something")->color("warning")!!}

{!!Form::button("Do something")->color("primary")!!}
```

### explicit color

[](#explicit-color)

```
// Examples
{!!Form::button("Button label")->warning()!!}
{!!Form::button("Button label")->outline()!!}
{!!Form::button("Button label")->success()!!
{!!Form::button("Button label")->danger()!!}
{!!Form::button("Button label")->secondary()!!}
{!!Form::button("Button label")->info()!!}
{!!Form::button("Button label")->light()!!}
{!!Form::button("Button label")->dark()!!}
{!!Form::button("Button label")->link()!!}
```

### Size

[](#size)

ParamTypeDefaultDescription$sizestringnullSize name```
// Examples
{!!Form::button("Do something")->size("sm")!!}

{!!Form::button("Do something")->size("lg")!!}
```

### Explicit size

[](#explicit-size)

```
// Examples
{!!Form::button("Button label")->sm()!!}
{!!Form::button("Button label")->lg()!!}
```

### Type

[](#type)

ParamTypeDefaultDescription$typestringnullType field```
// Examples

// Password field
{!!Form::text('password', 'Your password')->type('password')!!}

// Number field
{!!Form::text('age', 'Your age')->type('number')!!}

// Email field
{!!Form::text('email', 'Your email')->type('email')!!}
```

### Name

[](#name)

ParamTypeDefaultDescription$namestringnullInput name```
// Examples
{!!Form::text('text')->name('name')!!}
```

### Label

[](#label)

ParamTypeDefaultDescription$labelstringnullInput label```
// Examples
{!!Form::text('age')->label('Your age')!!}
```

### Default Value

[](#default-value)

ParamTypeDefaultDescription$valuemixednullInput value```
// Example
{!!Form::text('name', 'Your name')->value('Maria')!!}
```

### Render

[](#render)

ParamTypeDefaultDescription$renderstringnullRender name```
// Examples

// Number field
{!!Form::render('text')->name('age')->label('Your age')!!}
```

### Chaining properties

[](#chaining-properties)

You can use chaining feature to use a lot of settings for each component

```
// Examples

{!!Form::open()->locale('forms.user')->put()->multipart()->route('user.add')->data($user)!!}

{!!Form::text('name', 'Name')->placeholder('Type your name')->lg()!!}

{!!Form::anchor("Link as a button")->sm()->info()->outline()!!}

{!!Form::submit('Awesome button')->id('my-btn')->disabled()->danger()->lg()!!}

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

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![bogordesaincom](https://avatars.githubusercontent.com/u/51335197?v=4)](https://github.com/bogordesaincom "bogordesaincom (3 commits)")

### Embed Badge

![Health badge](/badges/imansugirman-laravel-customui-forms/health.svg)

```
[![Health](https://phpackages.com/badges/imansugirman-laravel-customui-forms/health.svg)](https://phpackages.com/packages/imansugirman-laravel-customui-forms)
```

###  Alternatives

[js-phpize/js-phpize

Convert js-like syntax to standalone PHP code.

23402.4k3](/packages/js-phpize-js-phpize)

PHPackages © 2026

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