trait InteractsWithTime (View source)

Methods

mixed
freezeTime(callable|null $callback = null)

Freeze time.

mixed
freezeSecond(callable|null $callback = null)

Freeze time at the beginning of the current second.

travel(int $value)

Begin travelling to another time.

mixed
travelTo(DateTimeInterface|Closure|Carbon|string|bool|null $date, callable|null $callback = null)

Travel to another time.

travelBack()

Travel back to the current time.

Details

mixed freezeTime(callable|null $callback = null)

Freeze time.

Parameters

callable|null $callback

Return Value

mixed

mixed freezeSecond(callable|null $callback = null)

Freeze time at the beginning of the current second.

Parameters

callable|null $callback

Return Value

mixed

Wormhole travel(int $value)

Begin travelling to another time.

Parameters

int $value

Return Value

Wormhole

mixed travelTo(DateTimeInterface|Closure|Carbon|string|bool|null $date, callable|null $callback = null)

Travel to another time.

Parameters

DateTimeInterface|Closure|Carbon|string|bool|null $date
callable|null $callback

Return Value

mixed

DateTimeInterface travelBack()

Travel back to the current time.

Return Value

DateTimeInterface