Skip to content

Commit 636fab8

Browse files
author
Kurt Friars
committed
Merge branch 'main' into 10.x
2 parents 5a50a65 + d173ebc commit 636fab8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/LaravelSchemaEventsServiceProvider.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ public function bootingPackage()
3030
});
3131

3232
Event::listen(MigrationStarted::class, config()->get('schema-events.listeners.ran'));
33-
Event::listen(MigrationsEnded::class, config()->get('schema-events.listeners.finished'));
33+
34+
// If the MigrationsEnded listener is not configured, the consuming
35+
// application wants to handle dispacthing the events itself.
36+
if ($listener = config()->get('schema-events.listeners.finished')) {
37+
Event::listen(MigrationsEnded::class, $listener);
38+
}
3439

3540
return $this;
3641
}

0 commit comments

Comments
 (0)