class CarbonImmutable extends CarbonImmutable

Carbon's immutable magic modifier metadata names its base class even though these methods preserve subclasses at runtime.

Traits

Methods

mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

never
dd(mixed ...$args)

Dump the given arguments and terminate execution.

from  Dumpable
dump(mixed ...$args)

Dump the given arguments.

from  Dumpable
static DateHelpers
createFromId(Uuid|Ulid|string $id)

Create a date instance from a given time-based UUID or ULID.

plus(int $years = 0, int $months = 0, int $weeks = 0, int $days = 0, int $hours = 0, int $minutes = 0, int $seconds = 0, int $microseconds = 0)

Get the current date / time plus a given amount of time.

minus(int $years = 0, int $months = 0, int $weeks = 0, int $days = 0, int $hours = 0, int $minutes = 0, int $seconds = 0, int $microseconds = 0)

Get the current date / time minus a given amount of time.

toMutable()

Convert the instance to a mutable date.

toImmutable()

Convert the instance to an immutable date.

static void
addMicroseconds(int|float $value = '1')

No description

static void
addMinute()

No description

static void
addSecond()

No description

static void
addSeconds(int|float $value = '1')

No description

static void
ceilSeconds(float $precision = '1')

No description

static void
subMinutes(int|float $value = '1')

No description

static void
subSeconds(int|float $value = '1')

No description

Details

in Conditionable at line 23
mixed when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Conditionable at line 56
mixed unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Dumpable at line 12
never dd(mixed ...$args)

Dump the given arguments and terminate execution.

Parameters

mixed ...$args

Return Value

never

in Dumpable at line 20
Dumpable dump(mixed ...$args)

Dump the given arguments.

Parameters

mixed ...$args

Return Value

Dumpable

in DateHelpers at line 20
static DateHelpers createFromId(Uuid|Ulid|string $id)

Create a date instance from a given time-based UUID or ULID.

Parameters

Uuid|Ulid|string $id

Return Value

DateHelpers

in DateHelpers at line 38
DateHelpers plus(int $years = 0, int $months = 0, int $weeks = 0, int $days = 0, int $hours = 0, int $minutes = 0, int $seconds = 0, int $microseconds = 0)

Get the current date / time plus a given amount of time.

Parameters

int $years
int $months
int $weeks
int $days
int $hours
int $minutes
int $seconds
int $microseconds

Return Value

DateHelpers

in DateHelpers at line 57
DateHelpers minus(int $years = 0, int $months = 0, int $weeks = 0, int $days = 0, int $hours = 0, int $minutes = 0, int $seconds = 0, int $microseconds = 0)

Get the current date / time minus a given amount of time.

Parameters

int $years
int $months
int $weeks
int $days
int $hours
int $minutes
int $seconds
int $microseconds

Return Value

DateHelpers

at line 29
Carbon toMutable()

Convert the instance to a mutable date.

Return Value

Carbon

at line 37
CarbonImmutable toImmutable()

Convert the instance to an immutable date.

Return Value

CarbonImmutable

at line 22
static void addMicroseconds(int|float $value = '1')

No description

Parameters

int|float $value

Return Value

void

at line 22
static void addMinute()

No description

Return Value

void

at line 22
static void addSecond()

No description

Return Value

void

at line 22
static void addSeconds(int|float $value = '1')

No description

Parameters

int|float $value

Return Value

void

at line 22
static void ceilSeconds(float $precision = '1')

No description

Parameters

float $precision

Return Value

void

at line 22
static void subMinutes(int|float $value = '1')

No description

Parameters

int|float $value

Return Value

void

at line 22
static void subSeconds(int|float $value = '1')

No description

Parameters

int|float $value

Return Value

void