2025-04-27 16:38:25 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
2026-02-22 10:41:33 +00:00
|
|
|
use App\Services\Micropub\Handlers\CardHandler;
|
|
|
|
|
use App\Services\Micropub\Handlers\EntryHandler;
|
|
|
|
|
use App\Services\Micropub\Handlers\UpdateHandler;
|
2025-04-27 16:38:25 +01:00
|
|
|
use App\Services\Micropub\MicropubHandlerRegistry;
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
|
|
class MicropubServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
public function register(): void
|
|
|
|
|
{
|
|
|
|
|
$this->app->singleton(MicropubHandlerRegistry::class, function () {
|
|
|
|
|
$registry = new MicropubHandlerRegistry;
|
|
|
|
|
|
|
|
|
|
// Register handlers
|
|
|
|
|
$registry->register('card', new CardHandler);
|
|
|
|
|
$registry->register('entry', new EntryHandler);
|
2026-02-22 10:15:35 +00:00
|
|
|
$registry->register('update', new UpdateHandler);
|
2025-04-27 16:38:25 +01:00
|
|
|
|
|
|
|
|
return $registry;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|