Skip to content

Commit

Permalink
Correct way to catch all Eloquent events
Browse files Browse the repository at this point in the history
  • Loading branch information
anorgan authored Oct 11, 2017
1 parent 7069c0a commit fb8166c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/LaravelCacheServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function boot()
return $this->app->make(CacheManager::class)->store()->getStore();
});

Event::listen(['eloquent.saved: *', 'eloquent.deleted: *', 'eloquent.restored: *'], function (Model $model) {
Event::listen(['eloquent.created: *', 'eloquent.updated: *', 'eloquent.deleted: *', 'eloquent.restored: *'], function (Model $model) {
/** @var CacheInvalidator $cacheInvalidator */
$cacheInvalidator = $this->app->make(CacheInvalidator::class);
$cacheInvalidator->invalidateByModel($model);
Expand Down

0 comments on commit fb8166c

Please sign in to comment.