Download the PHP package michalkortas/laravelforms without Composer
On this page you can find all versions of the php package michalkortas/laravelforms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michalkortas/laravelforms
More information about michalkortas/laravelforms
Files in michalkortas/laravelforms
Package laravelforms
Short Description A simple library to make Laravel Blade forms faster and easier
License MIT
Homepage https://webroad.dev/packages/laravelforms/documentation
Informations about the package laravelforms
laravelforms
A simple library to make Laravel Blade forms faster and easier. Every component returns full form control with Bootstrap CSS classes. Out of the box supports Laravel validation errors.
Supported form input components
- Checkbox
- Color
- Date
- DateTime
- Hidden
- Number
- Password
- Phone
- Radio
- Select
- Select Multiple
- Text
- Textarea
- Url
- File
- Time
- Month
Licence
MIT
Documentation & usage
Documentation is available on package website https://webroad.dev/packages/laravelforms/documentation
Packagist: https://packagist.org/packages/michalkortas/laravelforms
Support
Laravel 7 and 8 are only supported versions
Installation
composer require michalkortas/laravelforms
Register new ServiceProvider (only if not exists - Laravel register it automatically, but who knows?) in config/app.php
Example
Simple Text input
Inserted Text component
HTML output:
Simple Select input
Inserted Select component
HTML output:
Using Laravel Models
You can also use Laravel Models to fill every inputs.
Simple inputs
HTML output:
Object key is set by "name" attribute. If you want to change it, use "model-key" attribute instead. This can be also relation path (separator: ".""), eg. firstrelation.second.id
HTML output:
Inputs with multiple values (eg. select multiple, checkbox)
If you want to get data from your Pivot relation to check multiple options, pass via model-key attribute relation path to related table. Last part of this path is a table field, that should be use to verify checked/selected state.
<x-form-checkbox :model="$model" model-key="departments.id" :options="$departments" label="Select department" />