20 lines
405 B
PHP
20 lines
405 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
class HtmlValidator
|
|
{
|
|
public static function validateSource(string $html)
|
|
{
|
|
$response = Http::withHeaders([
|
|
'Content-Type' => 'text/html; charset=utf-8',
|
|
])->withBody($html, 'text/html')->post('http://nu-validator:8888/?out=json');
|
|
|
|
$json = $response->json();
|
|
|
|
return $json;
|
|
}
|
|
}
|