Skip to content

Commit

Permalink
Added event dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
simba77 committed Jan 28, 2023
1 parent e6c9301 commit 17fb62a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions system/src/ConfigProvider.php
Expand Up @@ -12,6 +12,7 @@

namespace Johncms;

use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\View\Factory;
use Johncms\Console\Commands\ClearCacheCommand;
use Johncms\Console\Commands\MakeMigrationCommand;
Expand Down Expand Up @@ -98,6 +99,7 @@ private function getDependencies(): array
LoggerInterface::class => Logger::class,
ExceptionHandlers::class => ExceptionHandlers::class,
RouterFactory::class => RouterFactory::class,
Dispatcher::class => DispatcherFactory::class,
],
];
}
Expand Down
16 changes: 16 additions & 0 deletions system/src/Events/DispatcherFactory.php
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Johncms\Events;

use Illuminate\Events\Dispatcher;
use Psr\Container\ContainerInterface;

class DispatcherFactory
{
public function __invoke(ContainerInterface $container): Dispatcher
{
return $container->get(Dispatcher::class);
}
}

0 comments on commit 17fb62a

Please sign in to comment.