All notable changes to laravel-html will be documented in this file.
- Add Laravel 13 support
- Add PHP 8.5 to test matrix
- Update test dependencies (Pest 4, PHPUnit 12, Testbench 11)
- Fix tests by restoring optional Request injection in Html class
- Remove deprecated PHPUnit 9 attributes from phpunit.xml.dist
- make BaseElement::unless() compatible with Conditionable::unless() by @miken32 in #260
Full Changelog: https://github.com/spatie/laravel-html/compare/3.12.2...3.12.3
- Document conditional methods by @miken32 in #261
Full Changelog: https://github.com/spatie/laravel-html/compare/3.12.1...3.12.2
- Update issue template by @AlexVanderbist in #257
- Add support for multiples requests in the same process by @gtg-bantonio in #258
- @gtg-bantonio made their first contribution in #258
Full Changelog: https://github.com/spatie/laravel-html/compare/3.12.0...3.12.1
- add disabled option to file input by @it-can in #253
- @it-can made their first contribution in #253
Full Changelog: https://github.com/spatie/laravel-html/compare/3.11.3...3.12.0
- Laravel 12.x Compatibility by @laravel-shift in #251
Full Changelog: https://github.com/spatie/laravel-html/compare/3.11.2...3.11.3
- Radio buttons with value 0 are incorrectly marked as checked by @acarpio89 in #249
- @acarpio89 made their first contribution in #249
Full Changelog: https://github.com/spatie/laravel-html/compare/3.11.1...3.11.2
- fix: Passing null to parameter #1 ($string) of type string is deprecated by @francoism90 in #244
Full Changelog: https://github.com/spatie/laravel-html/compare/3.11.0...3.11.1
- Add some attributes by @francoism90 in #239
- @francoism90 made their first contribution in #239
Full Changelog: https://github.com/spatie/laravel-html/compare/3.10.1...3.11.0
- Fix value omitted when input created with no name by @raveren in #235
- Fix value omitted when input created with no name by @raveren in #236
- Fix for Select and model's relationships by @nikosv in #237
- @nikosv made their first contribution in #237
Full Changelog: https://github.com/spatie/laravel-html/compare/3.10.0...3.10.1
- Update docs for name attribute by @bskl in #225
- Add Conditionable trait: now
->when()helper is available on all elements by @raveren in #234
Full Changelog: https://github.com/spatie/laravel-html/compare/3.9.0...3.10.0
Full Changelog: https://github.com/spatie/laravel-html/compare/3.8.0...3.9.0
- Add autocomplete attribute helper to the form element by @raveren in #221
- Added support for Htmlable contents in BaseElement by @hemmesdev in #215
- Register Service Provider in Laravel 11 by @gqrdev in #224
- Add name attribute to form element by @bskl in #223
Full Changelog: https://github.com/spatie/laravel-html/compare/3.7.0...3.8.0
- Fix return value in docs in element-methods.md by @raveren in #218
- Add autocomplete attribute helper to input, select and textarea by @raveren in #219
- Fix link with version in documentation by @fey in #217
Full Changelog: https://github.com/spatie/laravel-html/compare/3.6.0...3.7.0
- Laravel 11.x Compatibility by @laravel-shift in #214
Full Changelog: https://github.com/spatie/laravel-html/compare/3.5.0...3.6.0
- Fix docblock to solve phpstan errors when passing an array to html()->div() by @SanderMuller in #210
- Documentation on how to extend the package by @azamtav in #204
Full Changelog: https://github.com/spatie/laravel-html/compare/3.3.0...3.4.0
- Add documentation for new FormElement::route() method by @miken32 in #190
- Update
.gitattributesby @totoprayogo1916 in #194 - Correction to docs re: readonly vs isReadonly by @sgilberg in #195
- Get value from model with casts php native enum by @bskl in #203
- @totoprayogo1916 made their first contribution in #194
- @sgilberg made their first contribution in #195
- @bskl made their first contribution in #203
Full Changelog: https://github.com/spatie/laravel-html/compare/3.2.2...3.3.0
- Allow setting a form action to a route by @miken32 in #189
- @miken32 made their first contribution in #189
Full Changelog: https://github.com/spatie/laravel-html/compare/3.2.1...3.2.2
- Convert all tests to Pest by @alexmanase in #183
- Laravel 10.x Compatibility by @laravel-shift in #184
- @alexmanase made their first contribution in #183
- @laravel-shift made their first contribution in #184
Full Changelog: https://github.com/spatie/laravel-html/compare/3.2.0...3.2.1
- Add
Pclass to render paragraphs
- Allow Laravel 9
- Add compatiblity with PHP 8.1. The only breaking change with v2 is that
readonlyhas been renamed toisReadonly.
- Better support for numeric values in attributes
- Add
targetattribute method to links and button
- add support for PHP 8
- add the disabled method to all elements that support the attribute (#165)
- Add support for Laravel 8
- Internal refactor to normalize availabel attribute methods
- add Laravel 7 support
- Added number input
- Laravel 6 support
- Better handling for
0values in inputs - Add
rangefor range inputs - Format date and time values
- Prevent password fields to be filled
- Changed the
valueparameter indatato an optional parameter
- Added Laravel 5.8 support
- Dropped PHP 7.0 support
- Dropped Laravel 5.4 support
- Dropped PHPUnit 6 support
- use
Arr::andStr::functions
- Added
unlessmethod and magic__callhandler (e.g.$input->valueUnless(false, 5)) - Added
sizeattribute method toInput - Added
nameattribute method toButton - Fixed checkbox value repopulation after request
- Improve default of
tellink
- Add support for Laravel 5.7
- Allow radio input check "0" value
- Correctly prefill form array attributes from the model
- Allow
nullchildren
- Revert comparison function change in
2.19.2
- Fixed comparison function for selected options in
Select
- Fixed
Html::radioauto-generated id's & checked behaviour
- Changed
Input::requireto accept a boolean value
- Added
Ielement class andHtml::ifactory method
- Added
Html::valuefunction that's a public method forold
- Added
Imgelement class andHtml::imgfactory method
- Removed
idfrom CSRF fields
- Added
Input::dateandInput::time
- Added
Input::disabled
- Added
Form::novalidate
- Fixed Laravel 5.6 compatibility
- Added Laravel 5.6 compatibility
- Fixed an issue with checkbox values
- Add
readonlymethod to input
- Fix
__callwhen using macros
Htmlableelements can now be used in thehtml()method- Array notation is now implicitly converted to dot notation in
old(e.g.foo[1] -> foo.1)
- Fixed old values containing
0
- Added
requiredmethod toSelect
- Added
requiredmethod toTextarea
- Fixed a bug with values that are a
"0"string
- Fixed a bug with values that are a
"0"string
- Added a magic
__callmethod that responds to methods ending withIf, so any method can be called with a condition as it's first argument. The method will only be applied if the condition is truthy.
- Added
BaseElement::datafor data attributes
- Added
BaseElement::setChildrento replace all children - Fixed a bug that didn't select options in optgroups when applying a value
- Added
BaseElement::stylefor setting the style attribute (with a string or an associative array) - Added
Html::resetfor form reset buttons
- Nothing changed, but
2.2.0was accidentally tagged as2.4.0. This release contains the actual latest version at the time of writing.
- Added
checkedanduncheckedmethods toInput
- Added
Optgroupelement - Added the ability to create optgroups in
Optionsby passing an array of groups with options
- Added
Html::fileand aFileelement for file inputs
- Fixed an issue that stripped square brackets from element attributes
- Fixed the
Htmlfacade
- Minimum requirements have been reduced to PHP 7.0
- Added a
html()helper function that returns an instance ofHtml - Added
Macroableto all elements andHtml - Loosened type hints in method signatures for flexibility
- Added
Html::multiselectmethod - Added
Select::multiplemethod
- Added
classmethod toHtml
- Added a
placeholdermethod toTextarea
- Added an empty
valuetoSelect::placeholder
- Added a
placeholdermethod toSelectfor default empty values
- Added a
Htmlfacade
- Fixed an issue where html was escaped when you didn't want it to do that, like in buttons and links
- Added
Html::radio - Fixed an issue that set the wrong
valuefor a checkbox created withHtml::checkbox - Fixed a case sensitivity issue with the
Textareaclass
- Initial release