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

Remove tenant storage deletion events

This commit is contained in:
lukinovec 2022-09-13 09:22:34 +02:00
parent 99c071d0de
commit 1b31bdb56b
3 changed files with 0 additions and 24 deletions

View file

@ -1,9 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Events;
class DeletingTenantStorage extends Contracts\TenantEvent
{
}

View file

@ -1,9 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Events;
class TenantStorageDeleted extends Contracts\TenantEvent
{
}

View file

@ -5,18 +5,12 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Listeners; namespace Stancl\Tenancy\Listeners;
use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\File;
use Stancl\Tenancy\Events\DeletingTenantStorage;
use Stancl\Tenancy\Events\TenantDeleted; use Stancl\Tenancy\Events\TenantDeleted;
use Stancl\Tenancy\Events\TenantStorageDeleted;
class DeleteTenantStorage class DeleteTenantStorage
{ {
public function handle(TenantDeleted $event): void public function handle(TenantDeleted $event): void
{ {
event(new DeletingTenantStorage($event->tenant));
File::deleteDirectory($event->tenant->run(fn () => storage_path())); File::deleteDirectory($event->tenant->run(fn () => storage_path()));
event(new TenantStorageDeleted($event->tenant));
} }
} }