fix: use Auth(), add new db proxy stop event refactor clickhouse view

This commit is contained in:
Andras Bacsai
2024-11-04 14:18:16 +01:00
parent 1ab459a09b
commit 7fb1a1fc75
22 changed files with 236 additions and 123 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Livewire\Subscription;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
use Stripe\Checkout\Session;
use Stripe\Stripe;
@@ -26,7 +27,7 @@ class PricingPlans extends Component
$payload = [
'allow_promotion_codes' => true,
'billing_address_collection' => 'required',
'client_reference_id' => auth()->user()->id.':'.currentTeam()->id,
'client_reference_id' => Auth::id().':'.currentTeam()->id,
'line_items' => [[
'price' => $priceId,
'adjustable_quantity' => [
@@ -43,7 +44,7 @@ class PricingPlans extends Component
],
'subscription_data' => [
'metadata' => [
'user_id' => auth()->user()->id,
'user_id' => Auth::id(),
'team_id' => currentTeam()->id,
],
],
@@ -60,7 +61,7 @@ class PricingPlans extends Component
'name' => 'auto',
];
} else {
$payload['customer_email'] = auth()->user()->email;
$payload['customer_email'] = Auth::user()->email;
}
$session = Session::create($payload);