We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd1f850 commit 1258b2cCopy full SHA for 1258b2c
1 file changed
app/Livewire/MobilePricing.php
@@ -24,8 +24,15 @@ public function handlePurchaseRequest(array $data)
24
return $this->createCheckoutSession($data['plan'], $user);
25
}
26
27
- public function createCheckoutSession(string $plan, ?User $user = null)
+ public function createCheckoutSession(?string $plan, ?User $user = null)
28
{
29
+ // This method is somehow getting called without a plan being passed in.
30
+ // Not sure how (probably folks hacking or a bot thing),
31
+ // but we will just return early when this happens.
32
+ if (! $plan) {
33
+ return;
34
+ }
35
+
36
// If a user isn't passed into this method, Livewire will instantiate
37
// a new User. So we need to check that the user exists before using it,
38
// and then use the authenticated user as a fallback.
0 commit comments