Files
ladill-servers/app/Services/Ssl/SslCertificateExpiryParser.php
T
isaaccladandCursor b6c8ac343f Extract Ladill Servers as standalone app at servers.ladill.com.
VPS and dedicated server ordering, managed panels, SSO, billing, and launcher integration — forked from hosting infrastructure with server-focused routes and dashboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 19:18:30 +00:00

30 lines
581 B
PHP

<?php
namespace App\Services\Ssl;
use Carbon\CarbonInterface;
use Illuminate\Support\Carbon;
class SslCertificateExpiryParser
{
public function parseOpenSslEndDate(string $output): ?CarbonInterface
{
$line = trim($output);
if ($line === '') {
return null;
}
if (str_contains($line, '=')) {
$line = trim((string) strstr($line, '='));
$line = ltrim($line, '=');
}
try {
return Carbon::parse($line);
} catch (\Throwable) {
return null;
}
}
}