MathiasGrimm\LaravelLogKeeper\Support\LogUtil::diffInDays PHP Метод

diffInDays() публичный статический Метод

Get the diff in days for a given file and carbon date
public static diffInDays ( $log, Carbon\Carbon $date ) : integer
$log
$date Carbon\Carbon
Результат integer
    public static function diffInDays($log, Carbon $date)
    {
        $logDate = static::getDate($log);
        $days = $logDate->diffInDays($date);
        return $days;
    }

Usage Example

 /**
  * @test
  */
 public function it_gets_the_diff()
 {
     $today = Carbon::today();
     $logDate = Carbon::today()->subDays(10);
     $log = "laravel-{$logDate->toDateString()}.log";
     $this->assertSame(10, LogUtil::diffInDays($log, $today));
 }
All Usage Examples Of MathiasGrimm\LaravelLogKeeper\Support\LogUtil::diffInDays