The
now
function creates a new Illuminate\Support\Carbon
instance for the current time:<?php $now = now();
<?php public function forLocal()
{
return URL::temporarySignedRoute(
'livewire.upload-file', now()->addMinutes(FileUploadConfiguration::maxUploadTime())
);
}
<?php if (app()->runningUnitTests())
{
@touch($this->path(), now()->timestamp);
}
}
<?php if ((FileUploadConfiguration::isUsingS3() or FileUploadConfiguration::isUsingGCS()) && ! app()->runningUnitTests()) {
return $this->storage->temporaryUrl(
$this->path,
now()->addDay()->endOfHour(),
['ResponseContentDisposition' => 'attachment; filename="' . $this->getClientOriginalName() . '"']
);
}
<?php if (method_exists($this->storage->getAdapter(), 'getTemporaryUrl')) {
return $this->storage->temporaryUrl($this->path, now()->addDay());
}
return URL::temporarySignedRoute(
<?php }
return URL::temporarySignedRoute(
'livewire.preview-file', now()->addMinutes(30)->endOfHour(), ['filename' => $this->getFilename()]
);
}
<?php foreach (FileUploadConfiguration::storage()->allFiles() as $fileShortPath) {
touch(FileUploadConfiguration::storage()->path($fileShortPath), now()->subDays(2)->timestamp);
}
Livewire::test(FileUploadComponent::class)
<?php foreach (FileUploadConfiguration::storage()->allFiles() as $fileShortPath) {
touch(FileUploadConfiguration::storage()->path($fileShortPath), now()->subDays(2)->timestamp);
}
Livewire::test(FileUploadComponent::class)
<?php foreach (FileUploadConfiguration::storage()->allFiles() as $fileShortPath) {
touch(FileUploadConfiguration::storage()->path($fileShortPath), now()->subDays(2)->timestamp);
}
Livewire::test(FileUploadComponent::class)
<?php {
Storage::fake('avatars');
$this->travelTo(now()->addMonth());
$file = UploadedFile::fake()->image('avatar.jpg');
<?php if (! $storage->exists($filePathname)) continue;
$yesterdaysStamp = now()->subDay()->timestamp;
if ($yesterdaysStamp > $storage->lastModified($filePathname)) {
$storage->delete($filePathname);
}
<?php $environmentLastModified = $hasEnvironment
? filemtime($environmentFile)
: now()->addDays(30)->getTimestamp();
$process = $this->startProcess($hasEnvironment);
<?php public function handle()
{
$this->publishedAt = now();
$this->determineWhatShouldBePublished();
<?php public function markAsFinished(string $batchId)
{
if (isset($this->batches[$batchId])) {
$this->batches[$batchId]->finishedAt = now();
}
}
<?php $batch = $this->createTestBatch($queue);
$this->assertFalse($batch->finished());
$batch->finishedAt = now();
$this->assertTrue($batch->finished());
$batch->options['progress'] = [];
<?php $this->assertTrue($batch->hasCatchCallbacks());
$this->assertFalse($batch->cancelled());
$batch->cancelledAt = now();
$this->assertTrue($batch->cancelled());
$this->assertIsString(json_encode($batch));