code: private function isInvalidLogDate($file)
      {
          $pattern = '/laravel-(\d){4}-(\d){2}-(\d){2}.log/';
  
          if ((bool) preg_match($pattern, $file, $matches) === false) {
              return true;
          }
  
          return false;
      }
docs: Check the date of the log file.
  
  @param string $file
  
  @return bool