URL not working in repeater action?

RepeatableEntry::make('items')
->schema([
TextEntry::make('edit')
->hiddenLabel()
->state('Edit')
->icon('heroicon-m-pencil-square')
->action(
Action::make('edit')
->label('Edit')
->icon('heroicon-m-pencil-square')
->action(fn ($record) => redirect(EditItem::getUrl(['record' => $record]))) // This works
->url(fn ($record) => EditItem::getUrl(['record' => $record])) // This DOESNT for some reason...
),
RepeatableEntry::make('items')
->schema([
TextEntry::make('edit')
->hiddenLabel()
->state('Edit')
->icon('heroicon-m-pencil-square')
->action(
Action::make('edit')
->label('Edit')
->icon('heroicon-m-pencil-square')
->action(fn ($record) => redirect(EditItem::getUrl(['record' => $record]))) // This works
->url(fn ($record) => EditItem::getUrl(['record' => $record])) // This DOESNT for some reason...
),
For some reason, using the url(...) method doeson't work. The generated $wire.target= is empty and as a result throws a console error
Alpine Expression Error: missing name after . operator

Expression: "$wire."

<button class="block" type="button" wire:click="" wire:loading.attr="disabled" wire:target="">
Alpine Expression Error: missing name after . operator

Expression: "$wire."

<button class="block" type="button" wire:click="" wire:loading.attr="disabled" wire:target="">
Am i doing something wrong? The URL is obviously correct since it works when I manually redirect() to it.
0 Replies
No replies yetBe the first to reply to this messageJoin