update a few things
This commit is contained in:
@@ -17,7 +17,7 @@ class Actions extends Component
|
||||
$response = Http::withHeaders([
|
||||
'Accept' => 'application/vnd.api+json',
|
||||
'Content-Type' => 'application/vnd.api+json',
|
||||
'Authorization' => 'Bearer ' . config('coolify.lemon_squeezy_api_key'),
|
||||
'Authorization' => 'Bearer ' . config('subscription.lemon_squeezy_api_key'),
|
||||
])->delete('https://api.lemonsqueezy.com/v1/subscriptions/' . $subscription_id);
|
||||
$json = $response->json();
|
||||
if ($response->failed()) {
|
||||
@@ -44,7 +44,7 @@ class Actions extends Component
|
||||
$response = Http::withHeaders([
|
||||
'Accept' => 'application/vnd.api+json',
|
||||
'Content-Type' => 'application/vnd.api+json',
|
||||
'Authorization' => 'Bearer ' . config('coolify.lemon_squeezy_api_key'),
|
||||
'Authorization' => 'Bearer ' . config('subscription.lemon_squeezy_api_key'),
|
||||
])->patch('https://api.lemonsqueezy.com/v1/subscriptions/' . $subscription_id, [
|
||||
'data' => [
|
||||
'type' => 'subscriptions',
|
||||
|
||||
@@ -16,11 +16,21 @@ class Server extends BaseModel
|
||||
ServerSetting::create([
|
||||
'server_id' => $server->id,
|
||||
]);
|
||||
StandaloneDocker::create([
|
||||
'name' => 'coolify',
|
||||
'network' => 'coolify',
|
||||
'server_id' => $server->id,
|
||||
]);
|
||||
if ($server->id === 0) {
|
||||
StandaloneDocker::create([
|
||||
'id' => 0,
|
||||
'name' => 'coolify',
|
||||
'network' => 'coolify',
|
||||
'server_id' => $server->id,
|
||||
]);
|
||||
} else {
|
||||
StandaloneDocker::create([
|
||||
'name' => 'coolify',
|
||||
'network' => 'coolify',
|
||||
'server_id' => $server->id,
|
||||
]);
|
||||
}
|
||||
|
||||
});
|
||||
static::deleting(function ($server) {
|
||||
$server->settings()->delete();
|
||||
|
||||
@@ -14,9 +14,9 @@ class Subscription extends Model
|
||||
}
|
||||
public function type()
|
||||
{
|
||||
$basic = explode(',', config('coolify.lemon_squeezy_basic_plan_ids'));
|
||||
$pro = explode(',', config('coolify.lemon_squeezy_pro_plan_ids'));
|
||||
$ultimate = explode(',', config('coolify.lemon_squeezy_ultimate_plan_ids'));
|
||||
$basic = explode(',', config('subscription.lemon_squeezy_basic_plan_ids'));
|
||||
$pro = explode(',', config('subscription.lemon_squeezy_pro_plan_ids'));
|
||||
$ultimate = explode(',', config('subscription.lemon_squeezy_ultimate_plan_ids'));
|
||||
|
||||
$subscription = $this->lemon_variant_id;
|
||||
if (in_array($subscription, $basic)) {
|
||||
|
||||
Reference in New Issue
Block a user