chore: code styling via pint
This commit is contained in:
@@ -2,15 +2,16 @@
|
||||
|
||||
namespace App\Livewire\Dashboard;
|
||||
|
||||
use Exception;
|
||||
use Log;
|
||||
use App\Models\ActivationKey;
|
||||
use App\Models\Plan;
|
||||
use Exception;
|
||||
use Livewire\Component;
|
||||
use Log;
|
||||
|
||||
class Pricing extends Component
|
||||
{
|
||||
public $plans;
|
||||
|
||||
public $activation_key;
|
||||
|
||||
public function mount(): void
|
||||
@@ -66,12 +67,12 @@ class Pricing extends Component
|
||||
$user->updateStripeCustomer([
|
||||
'address' => [
|
||||
'postal_code' => '10001',
|
||||
'country' => 'US',
|
||||
'country' => 'US',
|
||||
],
|
||||
'name' => $user->name,
|
||||
'email' => $user->email,
|
||||
]);
|
||||
$user->creditBalance($plan->price * 100, 'Premium Top-up for plan: ' . $plan->name);
|
||||
$user->creditBalance($plan->price * 100, 'Premium Top-up for plan: '.$plan->name);
|
||||
$balance = $user->balance();
|
||||
$user->newSubscription('default', $plan->pricing_id)->create();
|
||||
|
||||
@@ -81,12 +82,15 @@ class Pricing extends Component
|
||||
$ends_at = now()->addYear();
|
||||
}
|
||||
$user->subscription('default')->cancelAt($ends_at);
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.dashboard.pricing');
|
||||
|
||||
Reference in New Issue
Block a user