The
now
function creates a new Illuminate\Support\Carbon
instance for the current time:<?php $now = now();
<?php public function handle(Login $event)
{
if ($event->user instanceof StatamicUser) {
User::fromUser($event->user)->setLastLogin(now());
}
}
}
<?php Cache::put($cacheKey, [
'completed' => false,
'output' => $this->output .= $output,
], now()->addMinutes(self::CACHE_EXPIRY_MINUTES));
}
<?php Cache::put($cacheKey, [
'completed' => true,
'output' => $this->output,
], now()->addMinutes(self::CACHE_EXPIRY_MINUTES));
}
<?php return true;
}
if ($collection->pastDateBehavior() === 'private' && $this->date()->lte(now())) {
return true;
}
<?php 'config' => config()->all(),
'fields' => $this->getRenderableFieldData(Arr::except($augmented, ['id', 'date', 'form'])),
'site_url' => Config::getSiteUrl(),
'date' => now(),
'now' => now(),
'today' => now(),
'site' => $this->site->handle(),
<?php 'fields' => $this->getRenderableFieldData(Arr::except($augmented, ['id', 'date', 'form'])),
'site_url' => Config::getSiteUrl(),
'date' => now(),
'now' => now(),
'today' => now(),
'site' => $this->site->handle(),
'locale' => $this->site->handle(),
<?php 'site_url' => Config::getSiteUrl(),
'date' => now(),
'now' => now(),
'today' => now(),
'site' => $this->site->handle(),
'locale' => $this->site->handle(),
]);
<?php public function dispatchCommit($message = null)
{
if ($delay = config('statamic.git.dispatch_delay')) {
$delayInMinutes = now()->addMinutes($delay);
$message = null;
}
<?php {
$this->waitIfProcessing();
Cache::put($this->mutex(), true, now()->addMinutes(5));
try {
$path = $this->generator->generateByAsset(
<?php ])->merge($fields->values());
if ($collection->dated()) {
$values['date'] = substr(now()->toDateTimeString(), 0, 10);
}
$viewData = [
<?php ->data($values);
if ($collection->dated()) {
$entry->date($preview['date'] ?? now()->format('Y-m-d-Hi'));
}
return $this->getDataResponse($request, $entry)->getContent();
<?php }
if ($entry->published()) {
WorkingCopy::fromRevision($target)->date(now())->save();
} else {
$entry->makeFromRevision($target)->published(false)->save();
}
<?php $lastActivity = session('last_activity', now()->timestamp);
return Carbon::createFromTimestamp($lastActivity)
->addMinutes(config('session.lifetime'))
<?php }
if ($entry->published()) {
WorkingCopy::fromRevision($target)->date(now())->save();
} else {
$entry->makeFromRevision($target)->published(false)->save();
}
<?php return;
}
session()->put('last_activity', now()->timestamp);
parent::saveSession($request);
}