Releases: glhd/aire
2.3.2
2.3.1
2.3.0
It's now possible to pass an array to asAlpineComponent()
to add additional x-data
values to the form:
{{ Aire::open()->asAlpineComponent(['foo' => 'bar']) }}
<div x-text="foo"></div>
Also, textarea
components accept a autoSize()
method that applies very simple auto size to contents behavior.
2.2.0
Adds a BindsToForm
interface. Anything that implements this interface can override form binding for Aire.
For example, if you wanted to edit a timestamp with three separate inputs, you could do something like:
class Event extends Model implements BindsToForm
{
protected $dates = ['starts_at'];
public function getAireFormData(): array
{
return array_merge($this->toArray(), [
'starts_at' => [
'date' => $this->starts_at->format('Y-m-d'),
'time' => $this->starts_at->format('g:i A'),
'timezone' => $this->starts_at->format('e'),
],
]);
}
}
Now your Aire form could look like:
{{ Aire::open()->resourceful($event) }}
{{ Aire::input('starts_at.date', 'Start Date') }}
{{ Aire::input('starts_at.time', 'Start Time') }}
{{ Aire::timezoneSelect('starts_at.timezone', 'Timezone') }}
{{ Aire::close() }}
2.1.0
Adds support for custom auto_id
generators:
Aire::setIdGenerator(function(Element $element, Form $form = null) {
return 'input-'.$element->getInputName();
}
Aire comes with support for automatically generating input's id
attribute, but the default implementation is focused on avoiding naming collisions, so IDs look something like __aire-1-password3
. You can now replace this with your own ID generator to match a convention you set in your app.
2.0.2
2.0.1
2.0.0
Releasing this as 2.0.0
even though it's very unlikely to be backwards-incompatible. This fixes an odd bug with old input (this is technically a BC-breaking change, but is very unlikely to affect anyone unless they've customized the ConvertEmptyStringsToNull
middleware). This release also adds Laravel 7 support and moves documentation to its own repo.
1.10.0
Version 1.10.0
introduces built-in Alpine.js support.