DateHelpers
trait DateHelpers
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.
from
Conditionable
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.
from
Conditionable
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.
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.
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.
in
Dumpable at line 12
never
dd(mixed ...$args)
Dump the given arguments and terminate execution.
at line 20
static DateHelpers
createFromId(Uuid|Ulid|string $id)
Create a date instance from a given time-based UUID or ULID.
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.
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.