Trying to organise the code better. It now temporarily doesn’t support update requests. Thought the spec defines them as SHOULD features and not MUST features. So safe for now :)
26 lines
661 B
PHP
26 lines
661 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Services\Micropub\CardHandler;
|
|
use App\Services\Micropub\EntryHandler;
|
|
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);
|
|
|
|
return $registry;
|
|
});
|
|
}
|
|
}
|