PHPackages                             ddrcha/easyfield - 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. ddrcha/easyfield

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

ddrcha/easyfield
================

My little input builder for Laravel 6 and more

1.0.0(6y ago)025MITHTMLPHP &gt;=7.0

Since Apr 7Pushed 5y agoCompare

[ Source](https://github.com/ddrcha/easyfield)[ Packagist](https://packagist.org/packages/ddrcha/easyfield)[ Docs](https://github.com/ddrcha/easyfield)[ RSS](/packages/ddrcha-easyfield/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel - Easyfield
===================

[](#laravel---easyfield)

My little input builder for Laravel 6 and more

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

[](#installation)

First install the package via composer

```
composer install ddrcha/easyfield

```

Then set reference to the package in adding two lines in your config/app.php file :

```
'providers' => [
	...
	Ddrcha\Easyfield\EasyfieldServiceProvider::class,
],

 'aliases' => [
	...
	'Easyfield' => Ddrcha\Easyfield\Facades\Easyfield::class,
],

```

Easyfield integrates by default templates for Bootstrap 5 and Materialize.

You must publish one of them to use the package :

```
php artisan vendor:publish --provider="Ddrcha\Easyfield\EasyfieldServiceProvider" --tag=bootstrap4
OR
php artisan vendor:publish --provider="Ddrcha\Easyfield\EasyfieldServiceProvider" --tag=materialize

```

All templates (one by input type) become so available in your "\[project\]/resources/views/vendor/easyfield" folder. You are free to modify it and add others views (that you can set with "template" option).

Icons
-----

[](#icons)

By default Easyfield use Font Awesome icons. If you want to use materialize icons, you must publish config file and modify the "icons" variable :

```
php artisan vendor:publish --provider="Ddrcha\Easyfield\EasyfieldServiceProvider" --tag=config

```

(A file named "easyfield.php" will be added into your "\[project\]/config" folder).

Usage
-----

[](#usage)

Don't forget to include libraries you want to use (Bootstrap 5, Materialize, Datepicker, Select2, Font Awesome, etc...) in your view before using Easyfield.

### The syntax

[](#the-syntax)

To display a field use this syntax :

```
{!! \Easyfield::input($input, $item, $errors) !!}
// $input (array) : All configuration options
// $item  (eloquent object) : main object used to complete the form
// $errors (array) : optional returns of validation form.

```

All available options in the detail :

OptionRequiredDescriptiontypeXString. 'type=' of the field. Possible values : 'text', 'password', 'textarea', 'select', 'file', 'radio', 'checkbox', 'submit' (button), 'switch'nameXString. 'name=' of the fieldlabelString. Text displayed before the inputrequiredString. Display \* before label if 'true', 'false' by defaulticonString. Add icon before field. The used library can be setted in config fileclassString. Additional classes spent to the input fieldwidthInteger. Size of the field (in 12 grid columns layout). '12' by defaultdataX (only for 'select' type)Eloquent collectionnoteString. Display a small information after fieldvalueString. If you want to set a particular value by defaultadditionalAssociative Array (key =&gt; value). Add all additional attributes you need !templateString. Use a custom template file (ex : "text2" will use "resources\\views\\vendor\\easyfield\\text2.blade.php")### Simple examples

[](#simple-examples)

Nota : For a best rendering insert all your fields into tags (if you use Bootstrap 4).

```

```

#### Text

[](#text)

```
// In your blade template
@php
	// ---- title
	$input = array(
		'type' => 'text',
		'name' => 'title',
		'label' => 'Title of post',
		'required' => true
	);
@endphp
{!! \Easyfield::input($input, $item, $errors) !!}

```

#### Password

[](#password)

```
// In your blade template
@php
	// ---- title
	$input = array(
		'type' => 'password',
		'name' => 'title',
		'label' => 'Title of post',
		'required' => true
	);
@endphp
{!! \Easyfield::input($input, $item, $errors) !!}

```

#### File

[](#file)

```
// In your blade template
@php
	// ---- avatar
	$input = array(
		'type' => 'file',
		'name' => 'avatar',
		'label' => 'User avatar',
		'icon' => 'fas fa-file',
		'note' => 'The photo must be a png or jpg file.'
	);
@endphp
{!! \Easyfield::input($input, $item, $errors) !!}

```

#### Select

[](#select)

```
// In your controller
$data['categories'] = \App\Models\Category::pluck('title', 'id'); // to spend in your view

// In your blade template
@php
	// ---- category_id
	$input = array(
		'type' => 'select',
		'name' => 'category_id',
		'label' => 'Main category',
		'data' => $categories
	);
@endphp
{!! \Easyfield::input($input, $selected, $errors) !!}

```

### Advanced examples

[](#advanced-examples)

#### Wysiwyg (via ckeditor 5)

[](#wysiwyg-via-ckeditor-5)

```
// In your blade template
@php
	// ---- content
	$input = array(
		'type' => 'text',
		'name' => 'content',
		'label' => 'Content of post',
		'class' => 'js-wysiwyg'
	);
@endphp
{!! \Easyfield::input($input, $item, $errors) !!}

// in your .js file
if ($('.js-wysiwyg').length){
	var allEditors = document.querySelectorAll('.js-wysiwyg');

	for (var i = 0; i < allEditors.length; ++i) {

		ClassicEditor
		.create(
			allEditors[i], ...
		);
	}
}

```

#### Date Picker (via jquery DatePicker)

[](#date-picker-via-jquery-datepicker)

```
// In your blade template
@php
	// ---- birthdate
	$input = array(
		'type' => 'text',
		'name' => 'birthdate',
		'label' => 'Date of birth',
		'class' => 'js-datepicker'
	);
@endphp
{!! \Easyfield::input($input, $item, $errors) !!}

// in your .js file
if ($('.js-datepicker').length){
	$('.js-datepicker').datepicker();
}

```

#### Multi select (via select2)

[](#multi-select-via-select2)

```
// In your controller
$data['editors'] = \App\Models\Editor::pluck('title', 'id'); // to spend in your view
$selectedEditors = array();
foreach($item->editors as $editor){
	$selectedEditors[] = $editor->id;
}
$data['selectedEditors'] = $selectedEditors:

// In your blade template
@php
	// ---- editors
	$input = array(
		'type' => 'select',
		'name' => 'editors[]',
		'label' => 'Editors',
		'data' => $editors,
		'class' => 'js-multiple-select',
		'value' => $selectedEditors, // array to set default values
		'additional' => ['multiple' => 'multiple'] // attribute required by select2
	);
@endphp
{!! \Easyfield::input($input, $item, $errors) !!}

// in your .js file
if ($('.js-multiple-select').length){
	$('.js-multiple-select').select2();
}

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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

2230d ago

### Community

Maintainers

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

---

Top Contributors

[![ddrcha](https://avatars.githubusercontent.com/u/13522715?v=4)](https://github.com/ddrcha "ddrcha (1 commits)")

---

Tags

laravelform

### Embed Badge

![Health badge](/badges/ddrcha-easyfield/health.svg)

```
[![Health](https://phpackages.com/badges/ddrcha-easyfield/health.svg)](https://phpackages.com/packages/ddrcha-easyfield)
```

###  Alternatives

[anahkiasen/former

A powerful form builder

1.4k1.4M14](/packages/anahkiasen-former)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)

PHPackages © 2026

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