1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 19:14:03 +00:00

Don't allow callables for queue chain

This commit is contained in:
Samuel Štancl 2019-10-26 21:49:53 +02:00
parent 96679240de
commit bdab188a61

View file

@ -162,9 +162,7 @@ class DatabaseManager
if ($this->app['config']['tenancy.queue_database_creation'] ?? false) {
$chain = [];
foreach ($afterCreating as $item) {
if (is_callable($item)) {
$chain[] = $item($tenant); // Callables are called and given $tenant
} elseif (is_string($item) && class_exists($item)) {
if (is_string($item) && class_exists($item)) {
$chain[] = new $item($tenant); // Classes are instantiated and given $tenant
} elseif ($item instanceof ShouldQueue) {
$chain[] = $item;