Component & Field changes
Refactor Form attributes, move from mount()
to formAttr()
mount()
to formAttr()
To protect form attributes from being exposed to frontend, they are now loaded as a Livewire computed property.
Before
Now
Component methods changed to protected
You might get errors from functions that has been changed from public
to protected
.
Methods that has been changed from public to protected | Comment |
onCreateModel | |
onUpdateModel | |
onDeleteModel | See special note on this page |
fields | |
saveFoo | |
beforeFormProperties | |
afterFormProperties |
delete() and onDeleteModel() security risk!
The delete()
method is public, which means that it can be called from frontend. You should probably override it to add your desired access control. That is what the onDeleteModel()
hook is for. Please override it in your component. (This is nothing new, I just want to emphasize the importance of this method.)
Search and replace:
Field type | Search | Replace with | Comment |
Input Number Color DateInput TimeInput DateTimeLocal Week Month Email Number Password Tel Url | ->class(...) | ->wrapperClass(...) | class() still exists, but is applied to the input instead of the outmost div. |
Input type hidden (Honeypot) | ->class( | ->wrapperClass( | See previous comment |
Deprecated fields or field methods
These methods are still kept in the code, for legacy reasons.
Deprecated | Replace with | Example/Comment |
noDefer() | deferEntangle( | Use any of the methods, read more: Alpine page |
SpatieTags | Tags or TagsSearch | |
keyAsAttribute | validationAttr( |
Changed defaults
Field | Comment |
Input, type number | max changed from 100 to infinite |
$onKeyDownEnter | Default = "saveAndStay" instead of null. |
Changed field methods
Method | Comment |
includeExternalScripts(bool $state = true) | Added option to pass true/false |
New field methods/attributes
Field | Method/comment |
Input |
Add classes to Blade UI Kit icons |
Heading Panel Tabs |
Add classes to Blade UI Kit icons |
All Fields |
Applied to field component, root div |
All Fields |
Append to, or replace, default field error class. |
All Fields |
It is optional to type |
Most Fields |
|
Fixed
Method | Comment |
class( ) |
|
Validation
The get_rules()
method has changed to follow Livewire standards. If you have overridden it in your components. Please se the Validation page for changes.
Last updated