diff --git a/src/Commands/Rollback.php b/src/Commands/Rollback.php index de8367fc..3086466e 100644 --- a/src/Commands/Rollback.php +++ b/src/Commands/Rollback.php @@ -11,6 +11,7 @@ use Stancl\Tenancy\Concerns\DealsWithMigrations; use Stancl\Tenancy\Concerns\HasATenantsOption; use Stancl\Tenancy\DatabaseManager; use Stancl\Tenancy\Events\DatabaseRolledBack; +use Stancl\Tenancy\Events\RollingBackDatabase; class Rollback extends RollbackCommand { @@ -59,6 +60,8 @@ class Rollback extends RollbackCommand tenancy()->runForMultiple($this->option('tenants'), function ($tenant) { $this->line("Tenant: {$tenant['id']}"); + event(new RollingBackDatabase($tenant)); + // Rollback parent::handle(); diff --git a/src/Events/DeletingDatabase.php b/src/Events/DeletingDatabase.php new file mode 100644 index 00000000..909661aa --- /dev/null +++ b/src/Events/DeletingDatabase.php @@ -0,0 +1,9 @@ +tenant)); + $this->tenant->database()->manager()->deleteDatabase($this->tenant); event(new DatabaseDeleted($this->tenant));