remove resale license

This commit is contained in:
peaklabs-dev
2024-11-13 18:38:22 +01:00
parent 9343cd6464
commit f55bb5b0fb
3 changed files with 0 additions and 66 deletions

View File

@@ -1,58 +0,0 @@
<?php
namespace App\Livewire\Settings;
use App\Actions\License\CheckResaleLicense;
use App\Models\InstanceSettings;
use Livewire\Component;
class License extends Component
{
public InstanceSettings $settings;
public ?string $instance_id = null;
protected $rules = [
'settings.resale_license' => 'nullable',
'settings.is_resale_license_active' => 'nullable',
];
protected $validationAttributes = [
'settings.resale_license' => 'License',
'instance_id' => 'Instance Id (Do not change this)',
'settings.is_resale_license_active' => 'Is License Active',
];
public function mount()
{
if (! isCloud()) {
abort(404);
}
if (! isInstanceAdmin()) {
return redirect()->route('home');
}
$this->instance_id = config('app.id');
$this->settings = instanceSettings();
}
public function render()
{
return view('livewire.settings.license');
}
public function submit()
{
$this->validate();
$this->settings->save();
if ($this->settings->resale_license) {
try {
CheckResaleLicense::run();
$this->dispatch('reloadWindow');
} catch (\Throwable $e) {
session()->flash('error', 'Something went wrong. Please contact support. <br>Error: '.$e->getMessage());
return redirect()->route('settings.license');
}
}
}
}