Download the PHP package spaanproductions/laravel-form without Composer
On this page you can find all versions of the php package spaanproductions/laravel-form. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spaanproductions/laravel-form
More information about spaanproductions/laravel-form
Files in spaanproductions/laravel-form
Package laravel-form
Short Description HTML and Form Builders for the Laravel Framework
License MIT
Homepage https://spaanproductions.nl
Informations about the package laravel-form
Laravel Form
A powerful HTML and Form Builder package for the Laravel Framework. This package provides an elegant and fluent interface for creating forms and HTML elements in your Laravel applications.
Features
- Form Builder: Create forms with model binding, CSRF protection, and method spoofing
- HTML Builder: Generate HTML elements, links, and assets with ease
- Eloquent Integration: Seamless integration with Eloquent models using the
FormAccessible
trait - Blade Directives: Use form and HTML helpers directly in your Blade templates
- Component System: Create custom form components for reusable form elements
- Helper Functions: Convenient helper functions for common operations
- Type Safety: Full support for PHP 8.0+ features and type hints
Requirements
- PHP 8.0 or higher
- Laravel 9.0, 10.0, 11.0, or 12.0
Installation
1. Install via Composer
2. Service Provider Registration
The package will automatically register itself with Laravel using auto-discovery. If you're using Laravel 5.4 or earlier, you'll need to manually register the service provider in your config/app.php
:
3. Publish Configuration (Optional)
The package doesn't require a configuration file by default, but you can publish one if you need to customize settings:
Basic Usage
Form Builder
Creating Forms
Form Input Types
Textarea
Select Dropdowns
Checkboxes and Radio Buttons
Buttons
HTML Builder
Links
Assets
Lists
Meta Tags
Generic HTML Tags
Helper Functions
The package provides several helper functions for convenience:
Blade Directives
You can use form and HTML methods directly as Blade directives:
Eloquent Integration
Using FormAccessible Trait
Add the FormAccessible
trait to your Eloquent models to enable form mutators:
Model Binding
Custom Components
Creating Custom Form Components
Creating Custom HTML Components
Advanced Features
Request Consideration
Enable request consideration to automatically fill form values from the current request:
Old Input Handling
The form builder automatically handles old input from failed validation:
Method Spoofing
The form builder automatically handles method spoofing for PUT, PATCH, and DELETE requests:
File Uploads
API Reference
Form Builder Methods
Method | Description |
---|---|
open($options) |
Open a new HTML form |
model($model, $options) |
Create a model-based form |
close() |
Close the current form |
token() |
Generate CSRF token field |
label($name, $value, $options) |
Generate a label element |
input($type, $name, $value, $options) |
Generate an input element |
text($name, $value, $options) |
Generate a text input |
email($name, $value, $options) |
Generate an email input |
password($name, $options) |
Generate a password input |
hidden($name, $value, $options) |
Generate a hidden input |
textarea($name, $value, $options) |
Generate a textarea |
select($name, $list, $selected, $options) |
Generate a select dropdown |
checkbox($name, $value, $checked, $options) |
Generate a checkbox |
radio($name, $value, $checked, $options) |
Generate a radio button |
submit($value, $options) |
Generate a submit button |
button($value, $options) |
Generate a button |
file($name, $options) |
Generate a file input |
image($url, $name, $options) |
Generate an image submit button |
reset($value, $options) |
Generate a reset button |
HTML Builder Methods
Method | Description |
---|---|
link($url, $title, $attributes) |
Generate an HTML link |
secureLink($url, $title, $attributes) |
Generate a secure HTML link |
linkAsset($url, $title, $attributes) |
Generate a link to an asset |
linkRoute($name, $title, $parameters, $attributes) |
Generate a link to a named route |
linkAction($action, $title, $parameters, $attributes) |
Generate a link to a controller action |
mailto($email, $title, $attributes) |
Generate a mailto link |
script($url, $attributes) |
Generate a script tag |
style($url, $attributes) |
Generate a style tag |
image($url, $alt, $attributes) |
Generate an image tag |
favicon($url, $attributes) |
Generate a favicon link |
meta($name, $content, $attributes) |
Generate a meta tag |
tag($tag, $content, $attributes) |
Generate a generic HTML tag |
ol($list, $attributes) |
Generate an ordered list |
ul($list, $attributes) |
Generate an unordered list |
dl($list, $attributes) |
Generate a definition list |
Testing
The package includes comprehensive test coverage. To run the tests:
Contributing
Please see CONTRIBUTING.md for details.
License
The Laravel Form package is open-sourced software licensed under the MIT license.
Support
- Issues: GitHub Issues
- Source: GitHub Repository
- Website: Spaan Productions
All versions of laravel-form with dependencies
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
illuminate/routing Version ^9.0|^10.0|^11.0|^12.0
illuminate/session Version ^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/view Version ^9.0|^10.0|^11.0|^12.0
nesbot/carbon Version ^2.0|^3.0