-
Currently I have write it this way:
it would be much better if
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
for the moment I will be using |
Beta Was this translation helpful? Give feedback.
-
Hi there, Both method was added to be used with Or, you can just add macros for such usage. Field::macro('showWhen', function ($condition) {
if ($condition === true) {
$this->show();
} else {
$this->hide();
}
});
Field::macro('showUnless', function ($condition) {
if ($condition === true) {
$this->hide();
} else {
$this->show();
}
}); |
Beta Was this translation helpful? Give feedback.
-
if anyone ended up here, this works: Field::macro('showWhen', function ($condition) {
if ($condition === true) {
$this->show();
} else {
$this->hide();
}
return $this;
});
Field::macro('showUnless', function ($condition) {
if ($condition === true) {
$this->hide();
} else {
$this->show();
}
return $this;
}); |
Beta Was this translation helpful? Give feedback.
if anyone ended up here, this works: