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

ActiveLibrary

konsulting/form
===============

HTML form builder

0.5.0(3mo ago)0380[1 issues](https://github.com/konsulting/form/issues)MITPHPCI failing

Since Jun 21Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/konsulting/form)[ Packagist](https://packagist.org/packages/konsulting/form)[ RSS](/packages/konsulting-form/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (4)Versions (22)Used By (0)

Form Builder
============

[](#form-builder)

*A library to simplify form building in php applications. It uses a template approach, supplied by [Plates](http://platesphp.com). It is inspired by the [Laravel Collective Form library](https://laravelcollective.com/docs/5.3/html) and a previous generations of form builder developed by Konsulting.*

You can use the library in any PHP project, but we have included some helpers for usage within a Laravel Project.

*Documentation is still being developed, so please bear with us.*

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

[](#installation)

We recommend using composer to install the library.

`composer require konsulting/form-builder`

Usage with Laravel
------------------

[](#usage-with-laravel)

The package will auto-register the Service Provider and Facade in Laravel 5.5+. In earlier versions of Laravel, you will need to manually register them yourself in your `config/app.php`.

```
"providers" => [
    ...
    "Konsulting\\FormBuilder\\Laravel\\FormBuilderServiceProvider"
],

"aliases" => [
    ...
    "Form" => "Konsulting\\FormBuilder\\Laravel\\FormBuilderFacade"
]
```

You will then be able to access the FormBuilder instance though the Facade in your views (or anywhere else you need to).

```
// For example
Form::text('name', $yourName)->withLabel('Your Name')
```

Usage outside Laravel
---------------------

[](#usage-outside-laravel)

To begin using the form builder, you need to construct it using the Plates Engine (which essentially tells it which templates to use) and a class resolver (which effectively tells the build where to look for each form elements' class).

```
    use League\Plates\Engine;
    use Konsulting\FormBuilder\FormBuilder;
    use Konsulting\FormBuilder\ClassResolver;

    //...

    $builder = new FormBuilder(
        new Engine(__DIR__ . '/../../vendor/konsulting/form-builder/partials/bootstrap3'),
        new ClassResolver('Konsulting\\FormBuilder\\Elements\\')
    );
```

There is a simple API to build up your form elements. Each element shares a set of common methods, and we have set up the base set of html form elements.

### Shared methods

[](#shared-methods)

#### Setting attributes

[](#setting-attributes)

- `withLabel(label)` and `withoutLabel`
- `withError(message)` and `withoutError`
- `withFeedback(type, message)` and `withoutFeedback`
- `withHelp(message)`
- `withAddon(content, position=before|after)` - specific addon to the input (e.g. calendar icon to the right of an input box)
- `prepend(content)` - place content before the whole html block
- `append(content)` - place content after the whole html block
- `withAttributes(['name' => value, ...])` - set a range of attributes, or those without specific setters

#### Retrieving attributes

[](#retrieving-attributes)

- `attributes([array_of_keys_wanted])`
- `attributesExcept([array_of_keys_to_exclude])`

### Form Elements

[](#form-elements)

- `input(type, name, value)`
- `checkbox(name, value)`
- `radio(name, value)`
- `select(name, options, selected)`
- `textarea(name, value)`
- `date(name, value)`
- `time(name, value)`
- `datetime(name, value)`

### Dates and time

[](#dates-and-time)

Dates and time have an additional method, `split()`, which is used to generate input boxes that are split into each component of the date/time. There is a DateTimeFormats helper class, which is used to set the formats for user input/display and for persistence.

The helper also contains functions used to help split the date into components or re-combine it based on the settings.

When using the `split()` method, your dates and times will need to be recombined when validating them, for example.

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

[](#contributing)

Contributions are welcome and will be fully credited. We will accept contributions by Pull Request.

Please:

- Use the PSR-2 Coding Standard
- Add tests, if you’re not sure how, please ask.
- Document changes in behaviour, including readme.md.

Testing
-------

[](#testing)

We use [PHPUnit](https://phpunit.de) for this package.

Run tests using PHPUnit: `vendor/bin/phpunit`

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance82

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 70% 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 ~157 days

Recently: every ~457 days

Total

21

Last Release

95d ago

### Community

Maintainers

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

---

Top Contributors

[![Keoghan](https://avatars.githubusercontent.com/u/6714599?v=4)](https://github.com/Keoghan "Keoghan (35 commits)")[![rdarcy1](https://avatars.githubusercontent.com/u/15962421?v=4)](https://github.com/rdarcy1 "rdarcy1 (13 commits)")[![AlistairEwanGrant](https://avatars.githubusercontent.com/u/83870696?v=4)](https://github.com/AlistairEwanGrant "AlistairEwanGrant (1 commits)")[![jocoDomino](https://avatars.githubusercontent.com/u/26391067?v=4)](https://github.com/jocoDomino "jocoDomino (1 commits)")

---

Tags

form-builderplates

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[justinwalsh/daux.io

Documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly

4.6k38.1k1](/packages/justinwalsh-dauxio)[daux/daux.io

Documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly

825191.0k1](/packages/daux-dauxio)[phpcfdi/cfditopdf

Create a generic PDF file from a CFDI 3.3 &amp; 4.0 (CLI included)

4144.3k4](/packages/phpcfdi-cfditopdf)[projek-xyz/slim-plates

Render your Slim 3 application views using Plates template engine.

2678.2k3](/packages/projek-xyz-slim-plates)[forme/framework

An MVC framework for WordPress.

175.0k3](/packages/forme-framework)[franzl/laravel-plates

The powerful native PHP templating system Plates for Laravel.

183.3k](/packages/franzl-laravel-plates)

PHPackages © 2026

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