On this page
Conditionable
trait Conditionable (View source)
Methods
| $this|mixed | when(mixed $value, callable $callback, callable|null $default = null) Apply the callback if the given "value" is truthy. |
|
| $this|mixed | unless(mixed $value, callable $callback, callable|null $default = null) Apply the callback if the given "value" is falsy. |
Details
$this|mixed when(mixed $value, callable $callback, callable|null $default = null)
Apply the callback if the given "value" is truthy.
$this|mixed unless(mixed $value, callable $callback, callable|null $default = null)
Apply the callback if the given "value" is falsy.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Support/Traits/Conditionable.html