trait
Illuminate
/
Support
/
Traits
/
Conditionable
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.
Conditionable
Methods
public
when ( $value , callable $callback , callable $default ) : $this|TWhenReturnType
Apply the callback if the given "value" is (or resolves to) truthy.
Parameters
- $value callable|TWhenParameter|null
- $callback callable|null
- $default callable|null
public
unless ( $value , callable $callback , callable $default ) : $this|TUnlessReturnType
Apply the callback if the given "value" is (or resolves to) falsy.
Parameters
- $value callable|TUnlessParameter|null
- $callback callable|null
- $default callable|null