Releases: formers/former
5.0.0
With thanks to the work @tortuetorche 2 years ago to get this started! ❤️
Added
-
Add CSS class to the label of a group, with the
addLabelClass()
method (#604) -
Bootstrap 5 support
-
Add Bootstrap 5 floating labels via the
floatingLabel()
method for<input>
,<select>
and<textarea>
tagsNOTE: You need to use floating label elements with a
vertical_open
Former instance!Usage with Laravel:
{!! Former::vertical_open() !!} {!! Former::text('test-floating-label-ok') ->placeholder('dummy placeholder') ->floatingLabel() !!} {!! Former::select('users-floating-label') ->options(['User One', 'User Two', 'User Three']) ->placeholder('Select placeholder') ->floatingLabel() !!} {!! Former::textarea('textarea-floating-label') ->floatingLabel() ->placeholder('dummy placeholder') !!} {!! Former::close() !!} {!! Former::vertical_open() !!} <div class="row"> <div class="col"> {!! Former::text('test-floating-label-one') ->placeholder('dummy placeholder') ->floatingLabel() !!} </div> <div class="col"> {!! Former::text('test-floating-label-two') ->placeholder('dummy placeholder') ->floatingLabel() !!} </div> </div> {!! Former::close() !!}
-
Add the switch markup which is a custom checkbox for Bootstrap 5
Some use cases with Laravel:
{!! Former::switch('valid_switch_ok') ->text('Valid switch OK') !!} {!! Former::switches('valid_inline_switches_ok') ->switches('first', 'second', 'third', 'fourth') ->inline() !!}
-
Add
removeGroupClass()
andremoveLabelClass()
methodsUsage with Laravel:
{!! Former::text('test') ->removeGroupClass('row') ->removeLabelClass('foo') !!}
Changed
- Better Bootstrap 4 support
- Breaking change: Escape HTML value of
plaintext
field by default (#605)
You can disable this new behavior with theescape_plaintext_value
former config option set tofalse
.
In your former config fileconfig/former.php
, you can enable or disable this feature:
<?php
return [
//...
// Whether Former should escape HTML tags of 'plaintext' fields
// Enabled by default
//
// Instead of disabled this option,
// you should use the 'HtmlString' class:
// Former::plaintext('text')
// ->forceValue(
// new Illuminate\Support\HtmlString('<b>HTML data</b>')
// )
'escape_plaintext_value' => true,
//...
];
4.9.0
- Allow installation on Laravel 11
4.8.1
4.8.0
- Allow installation on Laravel 10
4.7.0
- Allow installation on Laravel 9
Bootstrap 5.0 support
Added
-
Add Bootstrap 5 floating labels via the
floatingLabel()
method for<input>
,<select>
and<textarea>
tagsNOTE: You need to use floating label elements with a
vertical_open
Former instance!Usage with Laravel:
{!! Former::vertical_open() !!} {!! Former::text('test-floating-label-ok') ->placeholder('dummy placeholder') ->floatingLabel() !!} {!! Former::select('users-floating-label') ->options(['User One', 'User Two', 'User Three']) ->placeholder('Select placeholder') ->floatingLabel() !!} {!! Former::textarea('textarea-floating-label') ->floatingLabel() ->placeholder('dummy placeholder') !!} {!! Former::close() !!} {!! Former::vertical_open() !!} <div class="row"> <div class="col"> {!! Former::text('test-floating-label-one') ->placeholder('dummy placeholder') ->floatingLabel() !!} </div> <div class="col"> {!! Former::text('test-floating-label-two') ->placeholder('dummy placeholder') ->floatingLabel() !!} </div> </div> {!! Former::close() !!}
-
Add the switch markup which is a custom checkbox for Bootstrap 5
Some use cases with Laravel:
{!! Former::switch('valid_switch_ok') ->text('Valid switch OK') !!} {!! Former::switches('valid_inline_switches_ok') ->switches('first', 'second', 'third', 'fourth') ->inline() !!}
-
Add
removeGroupClass()
andremoveLabelClass()
methodsUsage with Laravel:
{!! Former::text('test') ->removeGroupClass('row') ->removeLabelClass('foo') !!}
WARNING: There is a bug in the HTMLObject package!
See my pull request for more info: Anahkiasen/html-object#34
Better Bootstrap 4 support and Former::plaintext() security fix
Added
- Add CSS class to the label of a group, with the
addLabelClass()
method (#604)
Changed
- Better Bootstrap 4 support
- Breaking change: Escape HTML value of
plaintext
field by default (#605)
You can disable this new behavior with theescape_plaintext_value
former config option set tofalse
.
In your former config fileconfig/former.php
, you can enable or disable this feature:
<?php
return [
//...
// Whether Former should escape HTML tags of 'plaintext' fields
// Enabled by default
//
// Instead of disabled this option,
// you should use the 'HtmlString' class:
// Former::plaintext('text')
// ->forceValue(
// new Illuminate\Support\HtmlString('<b>HTML data</b>')
// )
'escape_plaintext_value' => true,
//...
];
4.6.0
- Drop support for Laravel < 5.1.2 (if you need support for earlier Laravel version you can continue to use Former 4.4.x and lower)
- Add support for PHP 8.0
4.5.0
- Drop support for PHP 7.1 and lower (if you need support for PHP 7.1 or lower use Former version 4.4.x or lower)
- Add support for Laravel 8
4.4.0
Merged Laravel 7 support (#593) - thanks @heathdutton