On this page
Carbon
class Carbon extends Carbon (View source)
Traits
Methods
$this|TWhenReturnType | when($value = null, callable $callback = null, callable $default = null) Apply the callback if the given "value" is (or resolves to) truthy. |
from Conditionable |
$this|TUnlessReturnType | unless($value = null, callable $callback = null, callable $default = null) Apply the callback if the given "value" is (or resolves to) falsy. |
from Conditionable |
static | setTestNow($testNow = null) {@inheritdoc} |
|
static Carbon | createFromId(Uuid|Ulid|string $id) Create a Carbon instance from a given ordered UUID or ULID. |
|
never | dd(mixed ...$args) Dump the instance and end the script. |
|
$this | dump() Dump the instance. |
Details
$this|TWhenReturnType when($value = null, callable $callback = null, callable $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
$this|TUnlessReturnType unless($value = null, callable $callback = null, callable $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
static setTestNow($testNow = null)
{@inheritdoc}
static Carbon createFromId(Uuid|Ulid|string $id)
Create a Carbon instance from a given ordered UUID or ULID.
never dd(mixed ...$args)
Dump the instance and end the script.
$this dump()
Dump the instance.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Support/Carbon.html