Skip to content

Commit

Permalink
Clear cached Event Facade instance
Browse files Browse the repository at this point in the history
Ensure that EventDispatcherDecorator is used for future calls to Event::listen().
  • Loading branch information
mortenscheel authored Oct 5, 2019
1 parent 45db277 commit 46028c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ActionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Lorisleiva\Actions;

use Illuminate\Support\Facades\Facade;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Lorisleiva\Actions\Commands\MakeActionCommand;
Expand All @@ -12,6 +13,7 @@ class ActionServiceProvider extends ServiceProvider
{
public function boot()
{
Facade::clearResolvedInstance('events');
$this->app->extend('events', function ($dispatcher, $app) {
return new EventDispatcherDecorator($dispatcher, $app);
});
Expand Down

0 comments on commit 46028c2

Please sign in to comment.