revolution/laravel-laminas-form
| Install | |
|---|---|
composer require revolution/laravel-laminas-form |
|
| Latest Version: | 1.12.0 |
| PHP: | ^8.2 |
| Laravel: | 12 · 13 |
| Older releases: | 4 – 11 |
| License: | MIT |
| Last Updated: | Oct 18, 2026 |
| Links: | GitHub · Packagist |
Laravel Laminas Form

https://docs.laminas.dev/laminas-form/
[!NOTE] This package is not actively maintained.
Requirements
- PHP >= 8.2
- Laravel >= 12.0
Versioning
- Basic : semver
- Drop old PHP or Laravel version :
+0.1. composer should handle it well. - Support only latest major version (
masterbranch), but you can PR to old branches.
Installation
composer require revolution/laravel-laminas-form
Suggest from LaminasForm
https://github.com/laminas/laminas-form/blob/master/composer.json
"laminas/laminas-captcha": "^2.7.1, required for using CAPTCHA form elements",
"laminas/laminas-code": "^2.6 || ^3.0, required to use laminas-form annotations support",
"laminas/laminas-eventmanager": "^2.6.2 || ^3.0, reuired for laminas-form annotations support",
"laminas/laminas-recaptcha": "in order to use the ReCaptcha form element"
Demo
https://github.com/kawax/laravel-laminas-form-project
Artisan command
php artisan make:form SampleForm
app/Http/Forms/SampleForm.php
Form class
namespace App\Http\Forms;
use Revolution\LaminasForm\Form;
use Laminas\Form\Element;
class SampleForm extends Form
{
/**
* Create a new form.
*
* @param null|string $name
*
* @return void
*/
public function __construct($name = null)
{
parent::__construct($name);
$this->setAttributes([
'action' => url('/'),
'method' => 'post',
]);
$name = new Element\Text('name');
$name->setAttributes([
'id' => 'name',
'class' => 'form-control',
'value' => old('name'),
]);
$name->setLabel('Your name');
$name->setLabelAttributes([
'class' => 'col-sm-2 col-form-label',
]);
$name->setOptions([
'wrapper-class' => 'mb-3 row',
'element-class' => 'col-sm-10',
]);
$this->add($name);
$this->add([
'type' => Element\Email::class,
'name' => 'email',
'attributes' => [
'id' => 'email',
'class' => 'form-control',
'value' => old('email'),
],
'options' => [
'label' => 'Your email address',
'label_attributes' => [
'class' => 'col-sm-2 col-form-label',
],
'wrapper-class' => 'mb-3 row',
'element-class' => 'col-sm-10',
],
]);
$this->add([
'type' => Element\Hidden::class,
'name' => '_token',
'attributes' => [
'value' => csrf_token(),
],
]);
$this->add([
'name' => 'send',
'type' => 'Submit',
'attributes' => [
'value' => 'Submit',
'class' => 'btn btn-primary',
],
]);
}
}
Controller
use App\Http\Forms\SampleForm;
public function __invoke()
{
$form = new SampleForm();
return view('form')->with(compact('form'));
}
use App\Http\Forms\SampleForm;
public function __invoke(SampleForm $form)
{
return view('form')->with(compact('form'));
}
View
Simple render
{{ $form->render() }}
Same as LaminasForm's echo $this->form($form);
Detail render
@php
$form->prepare();
@endphp
{!! $form->form()->openTag($form) !!}
{{ csrf_field() }}
<div class="mb-3 row">
<label for="name" class="col-sm-3 col-form-label">{!! $form->get('name')->getLabel() !!}</label>
<div class="col-sm-9">
{!! $form->formInput($form->get('name')) !!}
</div>
</div>
<div class="mb-3 row">
<label for="email" class="col-sm-3 col-form-label">{!! $form->get('email')->getLabel() !!}</label>
<div class="col-sm-9">
{!! $form->formInput($form->get('email')) !!}
</div>
</div>
<div class="mb-3 row">
<div class="col-sm-9 offset-sm-3">
{!! $form->formSubmit($form->get('send')) !!}
</div>
</div>
{!! $form->form()->closeTag($form) !!}
Form object can call Laminas's ViewHelper by magic method.
See https://docs.laminas.dev/quick-start/
ViewHelper render
{{ $form->render('bootstrap5horizon') }}
https://github.com/kawax/laravel-laminas-form/blob/master/docs/helpers.md
Validation
Use Laravel's FormRequest.
LICENSE
MIT
Copyright kawax
Related Packages
Form validation and generation for PHP with custom frontend generators
A command to help automate the clean up and removal of old form submissions.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.12.0 | ^8.2 | ^12.0|| | MIT | |
| 1.11.0 | ^8.2 | ^11.0|| | MIT | |
| 1.10.0 | ^8.1 | ^10.0|| | MIT | |
| 1.9.0 | ^8.0 | ^9.0|| | MIT | |
| 1.8.0 | ^7.4|| | ^6.0|| | MIT | |
| 1.7.2 | ^7.3|| | ^6.0|| | MIT | |
| 1.7.1 | ^7.3|| | ^6.0|| | MIT | |
| 1.7.0 | ^7.3|| | ^6.0|| | MIT | |
| 1.6.0 | ^7.3|| | ^6.0|| | MIT | |
| 1.5.0 | ^7.3|| | ^6.0|| | MIT | |
| 1.4.1 | ^7.2|| | ^6.0|| | MIT | |
| 1.4.0 | ^7.2|| | ^6.0|| | MIT | |
| 1.3.3 | ^7.2|| | * | MIT | |
| 1.3.2 | ^7.2|| | * | MIT | |
| 1.3.1 | ^7.2|| | * | MIT | |
| 1.3.0 | ^7.2|| | * | MIT | |
| 1.2.5 | ^7.2|| | * | MIT | |
| 1.2.4 | ^7.2|| | * | MIT | |
| 1.2.3 | ^7.2|| | * | MIT | |
| 1.2.2 | ^7.2|| | * | MIT | |
| 1.2.1 | ^7.2|| | * | MIT | |
| 1.2.0 | ^7.2 | * | MIT | |
| 1.1.8 | >=7.1.3 | * | MIT | |
| 1.1.7 | >=7.1.3 | * | MIT | |
| 1.1.6 | >=7.1.3 | * | MIT | |
| 1.1.5 | >=7.1.3 | ^5.5 || | MIT | |
| 1.1.4 | >=7.1.3 | ^5.5 | MIT | |
| 1.1.3 | >=7.1.3 | ^5.5 | MIT | |
| 1.1.2 | >=7.1.3 | ^5.5 | MIT | |
| 1.1.1 | >=7.1.3 | ^5.5 | MIT |
Showing the latest 30 of 42. See every release on Packagist