mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:34:04 +00:00
Update MigrateFreshOverride
This commit is contained in:
parent
5fa50cdd49
commit
987ac9a347
1 changed files with 8 additions and 2 deletions
|
|
@ -5,13 +5,19 @@ declare(strict_types=1);
|
||||||
namespace Stancl\Tenancy\Commands;
|
namespace Stancl\Tenancy\Commands;
|
||||||
|
|
||||||
use Illuminate\Database\Console\Migrations\FreshCommand;
|
use Illuminate\Database\Console\Migrations\FreshCommand;
|
||||||
|
use Stancl\Tenancy\Database\Contracts\TenantWithDatabase;
|
||||||
|
|
||||||
class MigrateFreshOverride extends FreshCommand
|
class MigrateFreshOverride extends FreshCommand
|
||||||
{
|
{
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
dd('overriden');
|
tenancy()->model()::all()->each(function(TenantWithDatabase $tenant) {
|
||||||
tenancy()->model()::all()->each->delete();
|
if (method_exists($tenant, 'domains')) {
|
||||||
|
$tenant->domains()->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
$tenant->delete();
|
||||||
|
});
|
||||||
|
|
||||||
return parent::handle();
|
return parent::handle();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue