livewire / volt

Volt is an elegantly crafted functional API for Livewire.
https://livewire.laravel.com/docs/volt
MIT License
339 stars 19 forks source link

Fix: Add missing argument 'except' to function 'url' in state properties #89

Closed bekepr closed 8 months ago

bekepr commented 8 months ago

Howdy!

I discovered a missing argument in Volt that exists in Livewire, and I believe it would be valuable to have this feature in Volt as well. The missing argument is 'except,' which is used in the 'url' function for state properties. In Livewire, the 'except' argument is employed to exclude specific values from the URL parameters. You can find more details about this feature here.

This fix is non-disruptive, as the 'except' argument is the last (fourth) parameter of the 'url' function, and it has a default value of 'null':

public function url(?string $as = null, ?bool $history = null, ?bool $keep = null, ?string $except = null): static
{
    return $this->attribute(Url::class, as: $as, history: $history, keep: $keep, except: $except);
}

I appreciate your consideration of this enhancement.

Best regards, Ádám Mezei