PHPackages                             spindogs/laravel-spin-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. [Templating &amp; Views](/categories/templating)
4. /
5. spindogs/laravel-spin-forms

ActiveLibrary[Templating &amp; Views](/categories/templating)

spindogs/laravel-spin-forms
===========================

Laravel SpinForm Blade Components

6.0.0(1mo ago)23.7k1MITPHP

Since Feb 2Pushed 1mo ago2 watchersCompare

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

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

LaravelSpinForms
================

[](#laravelspinforms)

[![Latest Version on Packagist](https://camo.githubusercontent.com/93a7017625a3f6b5c2995cbab0118f3827631fc5f291b07cffb8d7b3dec78d81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370696e646f67732f6c61726176656c2d7370696e2d666f726d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spindogs/laravel-spin-forms)[![Total Downloads](https://camo.githubusercontent.com/920f9ea82d673b135a0c2335e0e4d298f357ac745ed16a64c4d064b4f7012dce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370696e646f67732f6c61726176656c2d7370696e2d666f726d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spindogs/laravel-spin-forms)[![Build Status](https://camo.githubusercontent.com/d9f22414fc652a84089a54dcc360ddd53c4249fdfb3433613d09c4cdf73b379e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7370696e646f67732f6c61726176656c2d7370696e2d666f726d732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/spindogs/laravel-spin-forms)

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

[](#installation)

Via Composer

```
$ composer require spindogs/laravel-spin-forms
```

Upon install/update, it is recommended to clear the view cache. If there are new components in here, then they will need to either be manually copied over from the spin-forms.php config file, or republish the service provider with the --force flag. *NB: using the --force command will overwrite your config file, so if you have any custom controllers or views, plase change them again*

```
php artisan view:clear
```

Some components require additional javascript to be used in conjunction with the FE Baseline, these are generated by the components, but you will need to add code to your layout page to display it.

```
@stack('scripts')
```

Components
----------

[](#components)

- Form
- Form Wrap
- Form Fieldset
- *Form Group (Deprecated)*
- Error List
- Button
- Label
- Input
- Textarea
- Checkbox
- Radio
- Select
- Date Picker
- Time Picker
- Date/Time Picker
- Help

Modification
------------

[](#modification)

You can modify/override any of the templates, by changing the view and class keys in the config file. To do this, you need to publish the vendor file.

```
php artisan vendor:publish --provider="Spindogs\LaravelSpinForms\SpinFormsServiceProvider"
```

```
return [
    'components' => [
        'form' => [
            'view'  => 'spin-forms::components.form', // DEFAULT
            'view'  => 'components.spin-forms.form', // OVERRIDE
            'class' => \Spindogs\LaravelSpinForms\View\Components\Form::class
        ],
    ]
]
```

Examples
--------

[](#examples)

### Form

[](#form)

Options

- **method** - *string* - DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT (Default: *POST*)
- **files** - *boolean* (Default: *false*)

DELETE, PATCH, PUT; will trigger the Laravel @method command to then spoof the verb.

The files variable, will add the enctype/multipart to the form tag. This needs to be sent as a boolean value, so needs to be in the component as :files="true"

```

```

### Error List

[](#error-list)

Displays all form errors in list.

```

```

### Button

[](#button)

Options

- **type** - *string* - Expected input: button/reset/submit (Default: *submit*)

This takes a slot as the entry for the button content.

```

Submit Form

```

### Form Wrap

[](#form-wrap)

Options

- **field-identifier** - *string* - Type of form element that is going to be present (*null*)

This is utilised by all elements as a div wrapper around all of the form element controls. This will display the content inside of it. Field Identifier is generally automatically generated.

```

    ...

```

### Form Fieldset

[](#form-fieldset)

This element is used to house checkboxes / radio buttons. Fieldset should be used over Group for accessibility. But we are not removing Group for backwards compatability. These elements are identical except for: HTML output, Title is required.

Options

- **name** - *string* - Name of inputs to be displayed inside the group, this is needed to correctly style the error (**required**)
- **type** - *string* - Either **checkbox**, or **radio**, needed to correctly generate the field identifier of the Form Wrap component. (**required**)
- **title** - *string* - Title for group of elements in the group (**required**)
- **required** - *boolean* - Adds asterisk next to title (Default: *false*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *false*)

```

    ...

```

### Form Group (Deprecated)

[](#form-group-deprecated)

This element is deprecated, but will still be available for backwards compataibility. This is almost identical to Form Fieldset.

Options

- **name** - *string* - Name of inputs to be displayed inside the group, this is needed to correctly style the error (**required**)
- **type** - *string* - Either **checkbox**, or **radio**, needed to correctly generate the field identifier of the Form Wrap component. (**required**)
- **title** - *string* - Title for group of elements in the group (Default: *null*)
- **required** - *boolean* - Adds asterisk next to title (Default: *false*)
- **field-wrap** - *boolean* - Wraps the input inside the field wrap div/class (Default: *true*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *false*)

```

    ...

```

### Input

[](#input)

Options

- **name** - *string* - Name of input (**required**)
- **id** - *string* - ID of input, if not given, randomly generated (Default: *null*)
- **label** - *string* - Label for input (Default: *null*)
- **type** - *string* - Any applicable types available for input, although not recomended for checkbox/radio (Default: *text*)
- **value** - *string* - This is the default value of the element on the page (Default: *null*)
- **required** - *boolean* - Adds asterisk next to label, and required tag to input (Default: *false*)
- **readonly** - *boolean* - Adds readonly attribute to input (Default: *false*)
- **field-wrap** - *boolean* - Wraps the input inside the field wrap div/class (Default: *true*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *true*)

Also takes all attributes and merges across, like min, max, step etc.

```

```

### Textarea

[](#textarea)

Options

- **name** - *string* - Name of textarea (**required**)
- **id** - *string* - ID of textarea, if not given, randomly generated (Default: *null*)
- **label** - *string* - Label for textarea (Default: *null*)
- **value** - *string* - This is the default value of the element on the page (Default: *null*)
- **required** - *boolean* - Adds asterisk next to label, and required tag to input (Default: *false*)
- **readonly** - *boolean* - Adds readonly attribute to input (Default: *false*)
- **field-wrap** - *boolean* - Wraps the input inside the field wrap div/class (Default: *true*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *true*)

Also takes all attributes and merges across.

```

```

### Checkbox

[](#checkbox)

Options

- **name** - *string* - Name of input (**required**)
- **id** - *string* - ID of checkbox, if not given, randomly generated (Default: *null*)
- **label** - *string* - Label for checkbox, if left as null, this is represented by a &amp;nbsp; (Default: *null*)
- **value** - *string* - Value for this checkbox to when selected (Default: *1*)
- **selected** - *boolean* - Denotes whether the checkbox should be checked as default (Default: *false*)
- **required** - *boolean* - Adds asterisk next to label (Default: *false*)
- **readonly** - *boolean* - Adds readonly attribute to input (Default: *false*)
- **field-wrap** - *boolean* - Wraps the input inside the field wrap div/class (Default: *true*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *false*)

It is higly recommended to utilise the Form Group element when using Checkboxes.

```

```

### Radio

[](#radio)

Options

- **name** - *string* - Name of input (**required**)
- **id** - *string* - ID of radio button, if not given, randomly generated (Default: *null*)
- **label** - *string* - Label for checkbox, if left as null, this is represented by a &amp;nbsp; (Default: *null*)
- **value** - *string* - Value for this checkbox to when selected (Default: *null*)
- **selected** - *boolean* - Denotes whether the checkbox should be checked as default (Default: *false*)
- **readonly** - *boolean* - Adds readonly attribute to input (Default: *false*)
- **field-wrap** - *boolean* - Wraps the input inside the field wrap div/class (Default: *true*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *false*)

It is higly recommended to utilise the Form Group element when using Radio Buttons.

```

```

### Select

[](#select)

Options

- **name** - *string* - Name of select (**required**)
- **id** - *string* - ID of select, if not given, randomly generated (Default: *null*)
- **label** - *string* - Label for the select (Default: *null*)
- **options** - *array* - Key =&gt; Array \[name, image\] array of options for each select. (Default: *\[\]*)
- **selected** - *string/array* - List of keys / single key for default selection on page view. (Default: *null*)
- **required** - *boolean* - Adds asterisk next to title (Default: *false*)
- **readonly** - *boolean* - Adds readonly attribute to input (Default: *false*)
- **field-wrap** - *boolean* - Wraps the input inside the field wrap div/class (Default: *true*)
- **multiple** - *boolean* - Allow multiple selection (Default: *false*)
- **images** - *boolean* - Adds images to each option, must be in array to work correctly (Default: *false*)
- **search** - *boolean* - Allow searching of dropdown (Default: *true*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *true*)
- **placeholder** - *string* - Adds placeholder row to select, add the content for it (Default: *null*, does not work with images)

Currently does not work with optgroup.

Example of $options and $selected

```
$options = [
    'arsenal' => ['name' => 'Arsenal', 'image' => '/images/badge/arsenal.png'],
    'chelsea' => ['name' => 'Chelsea', 'image' => '/images/badge/chelsea.png'],
    'liverpool' => ['name' => 'Liverpool', 'image' => '/images/badge/liverpool.png'],
    'man-united' => ['name' => 'Manchester United', 'image' => '/images/badge/man-united.png']
];

$selected_singular = 'arsenal';

$selected_multiple = ['arsenal', 'liverpool'];
```

```

```

### Date Picker

[](#date-picker)

Options

- **name** - *string* - Name of input (**required**)
- **id** - *string* - ID of input, if not given, randomly generated (Default: *null*)
- **label** - *string* - Label for input (Default: *null*)
- **value** - *string* - This is the default value of the element on the page. Must be in format Y-m-d, otherwise will not render the default date (Default: *null*)
- **required** - *boolean* - Adds asterisk next to title (Default: *false*)
- **field-wrap** - *boolean* - Wraps the input inside the field wrap div/class (Default: *true*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *true*)

```

```

### Date and Time Picker

[](#date-and-time-picker)

Options

- **name** - *string* - Name of input (**required**)
- **id** - *string* - ID of input, if not given, randomly generated (Default: *null*)
- **label** - *string* - Label for input (Default: *null*)
- **value** - *string* - This is the default value of the element on the page. Must be in format Y-m-d H:i, otherwise will not render the default date/time (Default: *null*)
- **required** - *boolean* - Adds asterisk next to title (Default: *false*)
- **field-wrap** - *boolean* - Wraps the input inside the field wrap div/class (Default: *true*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *true*)

```

```

### Time Picker

[](#time-picker)

Options

- **name** - *string* - Name of input (**required**)
- **id** - *string* - ID of input, if not given, randomly generated (Default: *null*)
- **label** - *string* - Label for input (Default: *null*)
- **value** - *string* - This is the default value of the element on the page. Must be in format H:i, otherwise will not render the default time. Regex to verify (Default: *null*)
- **required** - *boolean* - Adds asterisk next to title (Default: *false*)
- **field-wrap** - *boolean* - Wraps the input inside the field wrap div/class (Default: *true*)
- **show-error** - *boolean* - Defines whether or not to display error text under element (Default: *true*)

```

```

### Help

[](#help)

You can also add help text, beofre and/or after the input elemtn with the use of the slots `pre_help` and `post_help`

```

    @slot('pre_help')
        Some help text before the form element
    @endslot
    @slot('post_help')
        Some help text after the form element
    @endslot

```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

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

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Adam Chapman](https://github.com/spindogs)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

Supported Versions
------------------

[](#supported-versions)

Versions will be supported for a limited amount of time.

VersionLaravel Version17/827/8/9310411511/12611/12/13

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance91

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~99 days

Recently: every ~284 days

Total

20

Last Release

43d ago

Major Versions

1.1.0 → 2.1.12021-10-28

v2.x-dev → v3.x-dev2023-02-15

3.0.0 → v4.x-dev2024-10-09

4.0.0 → 5.0.02026-02-03

5.0.0 → 6.0.02026-03-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dd8906eccff8ca99b4a04b796c96fef7967497538a36d567ef6aa6b1e1cf9f9?d=identicon)[spindogs](/maintainers/spindogs)

---

Top Contributors

[![ZaraB31](https://avatars.githubusercontent.com/u/107042077?v=4)](https://github.com/ZaraB31 "ZaraB31 (3 commits)")[![Geoff10](https://avatars.githubusercontent.com/u/9077806?v=4)](https://github.com/Geoff10 "Geoff10 (2 commits)")[![adzchappers](https://avatars.githubusercontent.com/u/611127?v=4)](https://github.com/adzchappers "adzchappers (1 commits)")

---

Tags

laravelLaravelSpinForms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spindogs-laravel-spin-forms/health.svg)

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

###  Alternatives

[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k454.7k15](/packages/robsontenorio-mary)[stijnvanouplines/blade-country-flags

A package to easily make use of country flags in your Laravel Blade views.

26307.2k6](/packages/stijnvanouplines-blade-country-flags)[technikermathe/blade-lucide-icons

A package to easily make use of Lucide icons in your Laravel Blade views.

18299.2k7](/packages/technikermathe-blade-lucide-icons)[saade/blade-iconsax

A package to easily make use of Iconsax in your Laravel Blade views.

21138.5k](/packages/saade-blade-iconsax)[mckenziearts/blade-untitledui-icons

A package to easily make use of UntitledUI icons in your Laravel Blade views.

16104.9k5](/packages/mckenziearts-blade-untitledui-icons)[afatmustafa/blade-hugeicons

A package to easily make use of Hugeicons(Free version) in your Laravel Blade views.

13129.0k3](/packages/afatmustafa-blade-hugeicons)

PHPackages © 2026

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