Date
class Date extends Facade
Constants
| protected STATE_CONTEXT_KEY |
The context key for the coroutine-local facade roots. |
| DEFAULT_FACADE |
|
Properties
| static protected Container|null | $app | The application instance being facaded. |
from Facade |
| static protected array | $resolvedInstance | The resolved object instances. |
from Facade |
| static protected array<string, true> | $scopedAccessors | Accessors whose resolved objects belong to a coroutine scope. |
from Facade |
| static protected array<string, int> | $coroutineAccessors | Accessors with coroutine-local roots, and their current generation. |
from Facade |
| static protected bool | $cached | Indicates if the resolved instance should be cached. |
from Facade |
Methods
Initiate a mock expectation on the facade.
Initiate a mock expectation on the facade.
Create a fresh mock instance for the given class.
Get the registered name of the component.
Resolve the facade root instance from the container.
Clear a resolved facade instance.
Get the application instance behind the facade.
Handle dynamic, static calls to the object.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
in
Facade at line 85
static void
resolved(Closure $callback)
Run a Closure when the facade has been resolved.
The callback is registered on the worker-global container and runs for every subsequent resolution of the facade accessor.
in
Facade at line 106
static MockInterface|null
spy()
Convert the facade into a Mockery spy.
Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 125
static MockInterface
partialMock()
Initiate a partial mock on the facade.
Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 142
static CompositeExpectation|Expectation|HigherOrderMessage
shouldReceive()
Initiate a mock expectation on the facade.
Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 159
static CompositeExpectation|Expectation|ExpectsHigherOrderMessage
expects()
Initiate a mock expectation on the facade.
Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 176
static protected MockInterface
createFreshMockInstance()
Create a fresh mock instance for the given class.
Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 189
static protected MockInterface
createMock()
Create a fresh mock instance for the given class.
in
Facade at line 199
static protected bool
isMock()
Determines whether a mock is set as the instance of the facade.
in
Facade at line 210
static protected string|null
getMockableClass()
Get the mockable class for the bound instance.
in
Facade at line 226
static void
swap(mixed $instance)
Hotswap the underlying instance behind the facade.
Replaces the worker-wide resolved facade instance and container binding; runtime use races across coroutines and changes every subsequent facade call.
in
Facade at line 239
static bool
isFake()
Determines whether a "fake" has been set as the facade instance.
in
Facade at line 250
static mixed
getFacadeRoot()
Get the root object behind the facade.
at line 118
static protected string
getFacadeAccessor()
Get the registered name of the component.
at line 126
static protected mixed
resolveFacadeInstance(string $name)
Resolve the facade root instance from the container.
in
Facade at line 312
static void
clearResolvedInstance(string|null $name = null)
Clear a resolved facade instance.
Later facade calls everywhere resolve again; only references already held keep the previous instance.
in
Facade at line 330
static void
clearResolvedInstances()
Clear all of the resolved instances.
Later facade calls everywhere resolve again; only references already held keep the previous instances.
in
Facade at line 344
static Collection
defaultAliases()
Get the application default aliases.
in
Facade at line 404
static Container|null
getFacadeApplication()
Get the application instance behind the facade.
in
Facade at line 415
static void
setFacadeApplication(Container|null $app)
Set the application instance.
Replaces the worker-wide facade application reference; runtime use races across coroutines and breaks every facade lookup.
in
Facade at line 427
static mixed
__callStatic(string $method, array $args)
Handle dynamic, static calls to the object.
at line 111
static bool
canBeCreatedFromFormat(string|null $date, string $format)
No description
at line 111
static CarbonInterface
create(mixed $year = '0', mixed $month = '1', mixed $day = '1', mixed $hour = '0', mixed $minute = '0', mixed $second = '0', mixed $timezone = 'null')
No description
at line 111
static CarbonInterface
createFromDate(mixed $year = 'null', mixed $month = 'null', mixed $day = 'null', mixed $timezone = 'null')
No description
at line 111
static CarbonInterface
createFromFormat(mixed $format, mixed $time, mixed $timezone = 'null')
No description
at line 111
static CarbonInterface
createFromIsoFormat(string $format, string $time, mixed $timezone = 'null', string|null $locale = '\'en\'', TranslatorInterface|null $translator = 'null')
No description
at line 111
static CarbonInterface
createFromLocaleFormat(string $format, string $locale, string $time, mixed $timezone = 'null')
No description
at line 111
static CarbonInterface
createFromLocaleIsoFormat(string $format, string $locale, string $time, mixed $timezone = 'null')
No description
at line 111
static CarbonInterface
createFromTime(mixed $hour = '0', mixed $minute = '0', mixed $second = '0', mixed $timezone = 'null')
No description
at line 111
static CarbonInterface
createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = 'null')
No description
at line 111
static CarbonInterface
createFromTimestampMs(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = 'null')
No description
at line 111
static CarbonInterface
createFromTimestampMsUTC(mixed $timestamp)
No description
at line 111
static CarbonInterface
createFromTimestampUTC(float|int|string $timestamp)
No description
at line 111
static CarbonInterface
createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = 'null')
No description
at line 111
static CarbonInterface
createMidnightDate(mixed $year = 'null', mixed $month = 'null', mixed $day = 'null', mixed $timezone = 'null')
No description
at line 111
static CarbonInterface
createSafe(mixed $year = 'null', mixed $month = 'null', mixed $day = 'null', mixed $hour = 'null', mixed $minute = 'null', mixed $second = 'null', mixed $timezone = 'null')
No description
at line 111
static CarbonInterface
createStrict(int|null $year = '0', int|null $month = '1', int|null $day = '1', int|null $hour = '0', int|null $minute = '0', int|null $second = '0', mixed $timezone = 'null')
No description
at line 111
static void
disableHumanDiffOption(mixed $humanDiffOption)
No description
at line 111
static void
enableHumanDiffOption(mixed $humanDiffOption)
No description
at line 111
static mixed
executeWithLocale(string $locale, callable $func)
No description
at line 111
static void
flushState()
No description
at line 111
static CarbonInterface
fromSerialized(mixed $value)
No description
at line 111
static array
getAvailableLocales()
No description
at line 111
static array
getAvailableLocalesInfo()
No description
at line 111
static array
getDays()
No description
at line 111
static null|string
getFallbackLocale()
No description
at line 111
static array
getFormatsToIsoReplacements()
No description
at line 111
static int
getHumanDiffOptions()
No description
at line 111
static array
getIsoUnits()
No description
at line 111
static array|false
getLastErrors()
No description
at line 111
static string
getLocale()
No description
at line 111
static int
getMidDayAt()
No description
at line 111
static CarbonInterface
getTestNow()
No description
at line 111
static string
getTimeFormatByPrecision(string $unitPrecision)
No description
at line 111
static Closure|string
getTranslationMessageWith(mixed $translator, string $key, string|null $locale = 'null', string|null $default = 'null')
No description
at line 111
static TranslatorInterface
getTranslator()
No description
at line 111
static array
getWeekendDays()
No description
at line 111
static int
getWeekEndsAt(string|null $locale = 'null')
No description
at line 111
static int
getWeekStartsAt(string|null $locale = 'null')
No description
at line 111
static bool
hasFormat(string $date, string $format)
No description
at line 111
static bool
hasFormatWithModifiers(string $date, string $format)
No description
at line 111
static bool
hasMacro(mixed $name)
No description
at line 111
static bool
hasRelativeKeywords(string|null $time)
No description
at line 111
static bool
hasTestNow()
No description
at line 111
static CarbonInterface
instance(DateTimeInterface $date)
No description
at line 111
static bool
isImmutable()
No description
at line 111
static bool
isModifiableUnit(mixed $unit)
No description
at line 111
static bool
isMutable()
No description
at line 111
static bool
isStrictModeEnabled()
No description
at line 111
static bool
localeHasDiffOneDayWords(string $locale)
No description
at line 111
static bool
localeHasDiffSyntax(string $locale)
No description
at line 111
static bool
localeHasDiffTwoDayWords(string $locale)
No description
at line 111
static bool
localeHasPeriodSyntax(mixed $locale)
No description
at line 111
static bool
localeHasShortUnits(string $locale)
No description
at line 111
static void
macro(string $name, callable|null $macro)
No description
at line 111
static CarbonInterface
make(mixed $var, DateTimeZone|string|null $timezone = 'null')
No description
at line 111
static void
mixin(object|string $mixin)
No description
at line 111
static CarbonInterface
now(DateTimeZone|string|int|null $timezone = 'null')
No description
at line 111
static CarbonInterface
parse(Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = 'null')
No description
at line 111
static CarbonInterface
parseFromLocale(string $time, string|null $locale = 'null', DateTimeZone|string|int|null $timezone = 'null')
No description
at line 111
static string
pluralUnit(string $unit)
No description
at line 111
static CarbonInterface
rawCreateFromFormat(string $format, string $time, mixed $timezone = 'null')
No description
at line 111
static CarbonInterface
rawParse(Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = 'null')
No description
at line 111
static void
resetMonthsOverflow()
No description
at line 111
static void
resetToStringFormat()
No description
at line 111
static void
resetYearsOverflow()
No description
at line 111
static void
serializeUsing(mixed $callback)
No description
at line 111
static void
setFallbackLocale(string $locale)
No description
at line 111
static void
setHumanDiffOptions(mixed $humanDiffOptions)
No description
at line 111
static void
setLocale(string $locale)
No description
at line 111
static void
setMidDayAt(mixed $hour)
No description
at line 111
static void
setTestNow(mixed $testNow = 'null')
No description
at line 111
static void
setTestNowAndTimezone(mixed $testNow = 'null', mixed $timezone = 'null')
No description
at line 111
static void
setToStringFormat(Closure|string $format)
No description
at line 111
static void
setTranslator(TranslatorInterface $translator)
No description
at line 111
static void
setWeekendDays(mixed $days)
No description
at line 111
static bool
shouldOverflowMonths()
No description
at line 111
static bool
shouldOverflowYears()
No description
at line 111
static string
singularUnit(string $unit)
No description
at line 111
static void
sleep(float|int $seconds)
No description
at line 111
static CarbonInterface
today(DateTimeZone|string|int|null $timezone = 'null')
No description
at line 111
static CarbonInterface
tomorrow(DateTimeZone|string|int|null $timezone = 'null')
No description
at line 111
static string
translateTimeString(string $timeString, string|null $from = 'null', string|null $to = 'null', int $mode = '\\Carbon\\CarbonInterface::TRANSLATE_ALL')
No description
at line 111
static string
translateWith(TranslatorInterface $translator, string $key, array $parameters = '[]', mixed $number = 'null')
No description
at line 111
static void
use(mixed $handler)
No description
at line 111
static void
useCallable(callable $callable)
No description
at line 111
static void
useClass(string $dateClass)
No description
at line 111
static void
useDefault()
No description
at line 111
static void
useFactory(Factory $factory)
No description
at line 111
static void
useMonthsOverflow(mixed $monthsOverflow = 'true')
No description
at line 111
static void
useStrictMode(mixed $strictModeEnabled = 'true')
No description
at line 111
static void
useYearsOverflow(mixed $yearsOverflow = 'true')
No description
at line 111
static mixed
withTestNow(mixed $testNow, callable $callback)
No description
at line 111
static Factory
withTimeZone(DateTimeZone|int|string $timezone)
No description
at line 111
static CarbonInterface
yesterday(DateTimeZone|string|int|null $timezone = 'null')
No description