ResolvesOnce
trait ResolvesOnce
Traits
Properties
| protected bool | $once | Indicates if the prop should be resolved only once. |
|
| protected bool | $refresh | Indicates if the prop should be forcefully refreshed. |
|
| protected int|null | $ttl | The expiration time in seconds. |
|
| protected string|null | $key | The custom key for resolving the once prop. |
Methods
Get the number of seconds until the given DateTime.
Get the "available at" UNIX timestamp.
If the given value is an interval, convert it to a DateTime instance.
Given a start time, format the total run time for human readability.
Mark the prop to be resolved only once.
Determine if the prop should be resolved only once.
Determine if the prop should be forcefully refreshed.
Get the custom key for resolving the once prop.
Set a custom key for resolving the once prop.
Mark the property to be forcefully sent to the client.
Get the expiration timestamp in milliseconds for the once prop.
Details
in
InteractsWithTime at line 17
protected int
secondsUntil(DateInterval|DateTimeInterface|int $delay)
Get the number of seconds until the given DateTime.
in
InteractsWithTime at line 29
protected int
availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)
Get the "available at" UNIX timestamp.
in
InteractsWithTime at line 41
protected DateTimeInterface|int
parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)
If the given value is an interval, convert it to a DateTime instance.
in
InteractsWithTime at line 57
protected int
currentTime()
Get the current system time as a UNIX timestamp.
in
InteractsWithTime at line 65
protected string
runTimeForHumans(float $startTime, float|null $endTime = null)
Given a start time, format the total run time for human readability.
at line 40
ResolvesOnce
once(bool $value = true, string|null $as = null, DateTimeInterface|DateInterval|int|null $until = null)
Mark the prop to be resolved only once.
at line 58
bool
shouldResolveOnce()
Determine if the prop should be resolved only once.
at line 66
bool
shouldBeRefreshed()
Determine if the prop should be forcefully refreshed.
at line 74
string|null
getKey()
Get the custom key for resolving the once prop.
at line 82
ResolvesOnce
as(BackedEnum|UnitEnum|string $key)
Set a custom key for resolving the once prop.
at line 96
ResolvesOnce
fresh(bool $value = true)
Mark the property to be forcefully sent to the client.
at line 106
ResolvesOnce
until(DateTimeInterface|DateInterval|int $delay)
Set the expiration for the once prop.
at line 116
int|null
expiresAt()
Get the expiration timestamp in milliseconds for the once prop.