Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fabio-ivona
Copy link
Contributor

Hi,

this PR will enable enum binding in modal parameters, this will allow to call

<button type="button" wire:click="$dispatch('openModal', {'component':'invoices.select-invoice','arguments':{'type':'outbound','status':'pending',}})">
    select invoice
</button>

with a modal like this one:

class SelectInvoice extends ModalComponent
{
    #[Rule('required')]
    public \App\Enums\Type $type;

    #[Rule('nullable')]
    public \App\Enums\Status $status;

    //...
}

before this fix, you will encounter this exception: Target [App\Enums\Type] is not instantiable.

with 6 lines of code, the enum value is resolved to its calss

@PhiloNL PhiloNL merged commit 0f64fc4 into wire-elements:main Sep 8, 2023
@PhiloNL
Copy link
Contributor

PhiloNL commented Sep 8, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants