Carbon
extends Carbon
in package
Uses
Dumpable, Conditionable
Table of Contents
Methods
- createFromId() : static
- Create a Carbon instance from a given ordered UUID or ULID.
- dd() : never
- Dump the given arguments and terminate execution.
- dump() : $this
- Dump the given arguments.
- setTestNow() : void
- {@inheritdoc}
- unless() : $this|TUnlessReturnType
- Apply the callback if the given "value" is (or resolves to) falsy.
- when() : $this|TWhenReturnType
- Apply the callback if the given "value" is (or resolves to) truthy.
Methods
createFromId()
Create a Carbon instance from a given ordered UUID or ULID.
public
static createFromId(Uuid|Ulid|string $id) : static
Parameters
- $id : Uuid|Ulid|string
Return values
staticdd()
Dump the given arguments and terminate execution.
public
dd(mixed ...$args) : never
Parameters
- $args : mixed
Return values
neverdump()
Dump the given arguments.
public
dump(mixed ...$args) : $this
Parameters
- $args : mixed
Return values
$thissetTestNow()
{@inheritdoc}
public
static setTestNow([mixed $testNow = null ]) : void
Parameters
- $testNow : mixed = null
unless()
Apply the callback if the given "value" is (or resolves to) falsy.
public
unless([callable($this): TUnlessParameter|null $value = null ][, callable($this, TUnlessParameter): TUnlessReturnType|null $callback = null ][, callable($this, TUnlessParameter): TUnlessReturnType|null $default = null ]) : $this|TUnlessReturnType
Parameters
- $value : callable($this): TUnlessParameter|null = null
- $callback : callable($this, TUnlessParameter): TUnlessReturnType|null = null
- $default : callable($this, TUnlessParameter): TUnlessReturnType|null = null
Tags
Return values
$this|TUnlessReturnTypewhen()
Apply the callback if the given "value" is (or resolves to) truthy.
public
when([callable($this): TWhenParameter|null $value = null ][, callable($this, TWhenParameter): TWhenReturnType|null $callback = null ][, callable($this, TWhenParameter): TWhenReturnType|null $default = null ]) : $this|TWhenReturnType
Parameters
- $value : callable($this): TWhenParameter|null = null
- $callback : callable($this, TWhenParameter): TWhenReturnType|null = null
- $default : callable($this, TWhenParameter): TWhenReturnType|null = null