deploy commit

This commit is contained in:
2026-07-15 17:23:15 +07:00
commit b94ef4a695
148 changed files with 14831 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\Services;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Http;
class SkinAiService
{
public static function predict(UploadedFile $image): ?float
{
$response = Http::timeout(5)
->withHeaders([
'Accept' => 'application/json',
// 'Authorization' => 'Bearer ' . config('ai.predict_key'),
])
->attach(
'image',
fopen($image->getRealPath(), 'r'),
$image->getClientOriginalName()
)
->post(config('ai.predict_url'));
if (! $response->ok() || ! isset($response['prediction'])) {
return null;
}
return (float) $response['prediction'];
}
}