1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 17:24:03 +00:00

Rolling back & deleting DB events

This commit is contained in:
Samuel Štancl 2020-05-24 20:52:50 +02:00
parent 2839f45196
commit 78c64f0425
4 changed files with 24 additions and 0 deletions

View file

@ -11,6 +11,7 @@ use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Stancl\Tenancy\Database\Models\Tenant;
use Stancl\Tenancy\Events\DatabaseDeleted;
use Stancl\Tenancy\Events\DeletingDatabase;
class DeleteDatabase implements ShouldQueue
{
@ -26,6 +27,8 @@ class DeleteDatabase implements ShouldQueue
public function handle()
{
event(new DeletingDatabase($this->tenant));
$this->tenant->database()->manager()->deleteDatabase($this->tenant);
event(new DatabaseDeleted($this->tenant));