for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spiral\LogViewer\Helpers;
use Carbon\Carbon;
class Timestamps
{
/**
* @param mixed $timestamp
* @param bool $relative
* @return string
*/
public function getTime($timestamp, bool $relative = false): string
if (empty($relative)) {
return $timestamp;
}
$carbon = new Carbon($timestamp);
return $carbon->diffForHumans($carbon->now());