Conditional Fields
What is wrong here? This isn't working. When the user selects the tier, I want the price to be set automatically.
Solution:Jump to solution
@MZX not related to the question, but
match
is nicer than switch
π
```php
$price = match ($state) {
'standard' => 14.75,
'advanced' => 26.54,...7 Replies
Is tier an Enum ? if so, you should set cases as this :
case Tier::Standard :
...
make the price ->reactive too
No, no need π
@BKF Dev didn't work
Solution
@MZX not related to the question, but
match
is nicer than switch
π
or inline:
if you use Filament V3, use live() instead of reactive()
This is what worked! Thanks a lot buddy
Both seem to work, but I guess live is the newer one so I'm going with that