Skip to content

Releases: glhd/aire

2.3.2

24 Sep 14:50
e3d8496
Compare
Choose a tag to compare

Addresses an issue when using Aire with Laravel Enum on Laravel 8.

2.3.1

10 Sep 16:52
Compare
Choose a tag to compare

Version 2.3.1 fixes an issue related to "falsy" values not being properly bound.

2.3.0

27 May 20:55
Compare
Choose a tag to compare

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

18 May 14:51
Compare
Choose a tag to compare

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

22 Apr 04:25
Compare
Choose a tag to compare

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

10 Apr 16:41
Compare
Choose a tag to compare

Fixed a bug where non-input elements would have value and x-model bound to them.

2.0.1

09 Apr 20:44
Compare
Choose a tag to compare

Fixes bug with nested values in Alpine components.

2.0.0

02 Apr 15:38
Compare
Choose a tag to compare

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

19 Feb 05:25
Compare
Choose a tag to compare

Version 1.10.0 introduces built-in Alpine.js support.

1.9.1

03 Feb 22:11
Compare
Choose a tag to compare

One small JavaScript bug fix + updated dependency.