Certified/app/Ocr/OcrManager.php
Joël van de Wouw ac340d125c
Some checks failed
linter / quality (push) Failing after 13s
tests / ci (8.3) (push) Failing after 2s
tests / ci (8.4) (push) Failing after 2s
tests / ci (8.5) (push) Failing after 3s
Initial commit
Certificate manager built on Laravel 13, Livewire 4, and Flux.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-12 14:44:58 +02:00

46 lines
1.1 KiB
PHP

<?php
namespace App\Ocr;
use App\Ocr\Providers\KlippaProvider;
use App\Ocr\Providers\MistralProvider;
use App\Ocr\Providers\NoneProvider;
use Illuminate\Support\Manager;
/**
* Resolves OCR providers by name (driver). The active provider is chosen
* per-user from their `ocr_provider` setting, and the API key is supplied
* per call, so the resolved drivers are stateless and safely cached.
*
* @method OcrProviderInterface driver(string|null $driver = null)
*/
class OcrManager extends Manager
{
public function getDefaultDriver(): string
{
return 'none';
}
public function createNoneDriver(): OcrProviderInterface
{
return new NoneProvider;
}
public function createKlippaDriver(): OcrProviderInterface
{
return new KlippaProvider;
}
public function createMistralDriver(): OcrProviderInterface
{
return new MistralProvider;
}
/**
* @return array<int, string>
*/
public static function availableProviders(): array
{
return ['none', 'klippa', 'mistral'];
}
}