Merge branch 'next' of github.com:coollabsio/coolify into next

This commit is contained in:
Andras Bacsai 2024-06-28 11:00:05 +02:00
commit 93d04ef426

View File

@ -14,13 +14,22 @@ class CloudCleanupSubs extends Command
public function handle() public function handle()
{ {
try { try {
if (! isCloud()) {
$this->error('This command can only be run on cloud');
return;
}
ray()->clearAll(); ray()->clearAll();
$this->info('Cleaning up subcriptions teams'); $this->info('Cleaning up subcriptions teams');
$stripe = new \Stripe\StripeClient(config('subscription.stripe_api_key')); $stripe = new \Stripe\StripeClient(config('subscription.stripe_api_key'));
$teams = Team::all()->sortBy('id'); $teams = Team::all()->filter(function ($team) {
return $team->id !== 0;
})->sortBy('id');
foreach ($teams as $team) { foreach ($teams as $team) {
$this->info("Checking team {$team->id}"); if ($team) {
$this->info("Checking team {$team->id}");
}
if (! data_get($team, 'subscription')) { if (! data_get($team, 'subscription')) {
$this->disableServers($team); $this->disableServers($team);