-
Description:I can't specify the currency that is taken from a relationship: Currency::make('Monthly price', function () {
return $this->prices()->monthly()->first()->amount;
})
->currency($this->prices()->monthly()->first()->currency), Possible solution is to make |
Beta Was this translation helpful? Give feedback.
Answered by
crynobone
Aug 9, 2022
Replies: 1 comment 10 replies
-
You can try: Currency::make('Monthly Price')
->tap(function ($field) {
$price = $this->prices()->monthly()->first();
$field->resolveUsing(function () use ($price) {
return $price->amount;
})->currency($price->currency);
})->exceptOnForms(), |
Beta Was this translation helpful? Give feedback.
10 replies
Answer selected by
crynobone
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can try: