From 9ffae89a71a971e8b78fff0075dff84062643285 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 11 Dec 2024 12:04:58 +0100 Subject: [PATCH] fix: remove resale_license from db as well --- app/Livewire/Settings/Index.php | 5 -- .../2024_12_10_122143_drop_resale_license.php | 30 +++++++++ database/seeders/InstanceSettingsSeeder.php | 1 - .../livewire/subscription/index.blade.php | 64 +++++++++---------- 4 files changed, 60 insertions(+), 40 deletions(-) create mode 100644 database/migrations/2024_12_10_122143_drop_resale_license.php diff --git a/app/Livewire/Settings/Index.php b/app/Livewire/Settings/Index.php index c1be35ced..7adb0f8a7 100644 --- a/app/Livewire/Settings/Index.php +++ b/app/Livewire/Settings/Index.php @@ -23,9 +23,6 @@ class Index extends Component #[Validate('nullable|string|max:255')] public ?string $fqdn = null; - #[Validate('nullable|string|max:255')] - public ?string $resale_license = null; - #[Validate('required|integer|min:1025|max:65535')] public int $public_port_min; @@ -83,7 +80,6 @@ class Index extends Component } else { $this->settings = instanceSettings(); $this->fqdn = $this->settings->fqdn; - $this->resale_license = $this->settings->resale_license; $this->public_port_min = $this->settings->public_port_min; $this->public_port_max = $this->settings->public_port_max; $this->custom_dns_servers = $this->settings->custom_dns_servers; @@ -122,7 +118,6 @@ class Index extends Component } $this->settings->fqdn = $this->fqdn; - $this->settings->resale_license = $this->resale_license; $this->settings->public_port_min = $this->public_port_min; $this->settings->public_port_max = $this->public_port_max; $this->settings->custom_dns_servers = $this->custom_dns_servers; diff --git a/database/migrations/2024_12_10_122143_drop_resale_license.php b/database/migrations/2024_12_10_122143_drop_resale_license.php new file mode 100644 index 000000000..aaf498c3b --- /dev/null +++ b/database/migrations/2024_12_10_122143_drop_resale_license.php @@ -0,0 +1,30 @@ +dropColumn('is_resale_license_active'); + $table->dropColumn('resale_license'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('instance_settings', function (Blueprint $table) { + $table->boolean('is_resale_license_active')->default(false); + $table->longText('resale_license')->nullable(); + }); + } +}; diff --git a/database/seeders/InstanceSettingsSeeder.php b/database/seeders/InstanceSettingsSeeder.php index 35fc8506b..7f2deb3a6 100644 --- a/database/seeders/InstanceSettingsSeeder.php +++ b/database/seeders/InstanceSettingsSeeder.php @@ -16,7 +16,6 @@ class InstanceSettingsSeeder extends Seeder InstanceSettings::create([ 'id' => 0, 'is_registration_enabled' => true, - 'is_resale_license_active' => true, 'smtp_enabled' => true, 'smtp_host' => 'coolify-mail', 'smtp_port' => 1025, diff --git a/resources/views/livewire/subscription/index.blade.php b/resources/views/livewire/subscription/index.blade.php index 5131ebd56..c29fdae89 100644 --- a/resources/views/livewire/subscription/index.blade.php +++ b/resources/views/livewire/subscription/index.blade.php @@ -2,42 +2,38 @@ Subscribe | Coolify - @if ($settings->is_resale_license_active) - @if (auth()->user()->isAdminFromSession()) -
-
-

Subscriptions

- @if (subscriptionProvider() === 'stripe' && $alreadySubscribed) - Manage My Subscription - @endif -
- @if (request()->query->get('cancelled')) -
- - - - Something went wrong with your subscription. Please try again or contact - support. -
+ @if (auth()->user()->isAdminFromSession()) +
+
+

Subscriptions

+ @if (subscriptionProvider() === 'stripe' && $alreadySubscribed) + Manage My Subscription @endif +
+ @if (request()->query->get('cancelled')) +
+ + + + Something went wrong with your subscription. Please try again or contact + support. +
+ @endif - @if (config('subscription.provider') === 'stripe') - - @endif -
- @else -
-
-

Subscription

-
-
You are not an admin or have been removed from this team. If this does not make sense, please contact - us.
-
- @endif + @if (config('subscription.provider') === 'stripe') + + @endif +
@else -
Resale license is not active. Please contact your instance admin.
+
+
+

Subscription

+
+
You are not an admin or have been removed from this team. If this does not make sense, please contact + us.
+
@endif