wip: migrate to livewire 3
This commit is contained in:
30
app/Livewire/Subscription/Show.php
Normal file
30
app/Livewire/Subscription/Show.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Subscription;
|
||||
|
||||
use App\Models\InstanceSettings;
|
||||
use Livewire\Component;
|
||||
|
||||
class Show extends Component
|
||||
{
|
||||
public InstanceSettings $settings;
|
||||
public bool $alreadySubscribed = false;
|
||||
public function mount() {
|
||||
if (!isCloud()) {
|
||||
return redirect('/');
|
||||
}
|
||||
$this->settings = InstanceSettings::get();
|
||||
$this->alreadySubscribed = currentTeam()->subscription()->exists();
|
||||
}
|
||||
public function stripeCustomerPortal() {
|
||||
$session = getStripeCustomerPortalSession(currentTeam());
|
||||
if (is_null($session)) {
|
||||
return;
|
||||
}
|
||||
return redirect($session->url);
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.subscription.show')->layout('layouts.subscription');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user