auto plan synchronization

This commit is contained in:
Čarodej
2022-04-04 19:05:02 +02:00
parent 80b2371868
commit bf6bc17d7d
22 changed files with 115 additions and 104 deletions
@@ -1,10 +1,11 @@
<?php
namespace Domain\Maintenance\Controllers;
use Artisan;
use DB;
use Schema;
use Storage;
use Artisan;
use Stripe\Plan;
use Illuminate\Support\Arr;
use Illuminate\Http\Request;
use Domain\Files\Models\File;
@@ -124,4 +125,12 @@ class UpgradeSystemController extends Controller
'type' => 'file',
]));
}
private function upgrade_to_2_0_13(): void
{
// Force plan synchronization
if (get_settings('license') === 'extended' && Plan::count() !== 0) {
Artisan::call('subscription:synchronize-plans');
}
}
}
@@ -64,7 +64,8 @@ class StorePaymentServiceCredentialsController
// Store credentials into the .env file
setEnvironmentValue($credentials[$request->input('service')]);
// TODO: call plan synchronization
// Call plan synchronization for makingcg/subscription package
cache()->add('action.synchronize-plans', now()->toString());
// Clear cache
if (! is_dev()) {