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

instanceof closure check

This commit is contained in:
Samuel Štancl 2019-10-25 19:16:28 +02:00
parent 81deb1c553
commit f6f6b51dc3

View file

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy;
use Closure;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\DatabaseManager as BaseDatabaseManager;
use Illuminate\Foundation\Application;
@ -165,7 +166,7 @@ class DatabaseManager
} else {
$manager->createDatabase($database);
foreach ($afterCreating as $item) {
if (is_object($item)) {
if (is_object($item) && ! $item instanceof Closure) {
$item->handle($tenant);
} else {
$item($tenant);