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:
parent
99c071d0de
commit
1b31bdb56b
3 changed files with 0 additions and 24 deletions
|
|
@ -1,9 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Stancl\Tenancy\Events;
|
|
||||||
|
|
||||||
class DeletingTenantStorage extends Contracts\TenantEvent
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Stancl\Tenancy\Events;
|
|
||||||
|
|
||||||
class TenantStorageDeleted extends Contracts\TenantEvent
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
@ -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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue