first commit
Some checks failed
Build / run (push) Has been cancelled

This commit is contained in:
maher
2025-10-29 11:42:25 +01:00
commit 703f50a09d
4595 changed files with 385164 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace Common\Domains\Validation;
use Common\Core\HttpClient;
use Illuminate\Support\Arr;
class ValidateLinkWithPhishtank
{
public function execute(string $url): bool
{
$key = settings('links.phishtank_key');
if (!$key) {
return true;
}
$appName = config('app.name');
$response = HttpClient::post(
'https://checkurl.phishtank.com/checkurl/',
[
'headers' => ['User-Agent' => "phishtank/$appName"],
'form_params' => [
'format' => 'json',
'app_key' => $key,
'url' => $url,
],
],
);
return Arr::get($response, 'results.valid', false);
}
}