SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'owner_id' cannot be null (SQL: insert into `order_items` (`owner_id`, `owner_type`, `process_at`, `currency`, `unit_price`, `quantity`, `tax_percentage`, `description`, `orderable_id`, `orderable_type`, `updated_at`, `created_at`) values (?, ?, 2019-06-29 14:16:40, EUR, 650, 1, 0, 6 Month Subscription, 6, Laravel\Spark\Subscription, 2019-06-29 14:30:34, 2019-06-29 14:30:34))
$subscription = $this->owner->subscriptions()->create([
'name' => $this->name,
'plan' => $this->plan->name(),
'quantity' => $this->quantity,
'tax_percentage' => $this->owner->taxPercentage() ?: 0,
'trial_ends_at' => $this->trialExpires,
'cycle_started_at' => $now,
'cycle_ends_at' => $this->nextPaymentAt,
]);
$subscription = $this->owner->subscriptions()->create([
'name' => $this->name,
'plan' => $this->plan->name(),
'quantity' => $this->quantity,
'owner_type' => get_class($this->owner),
'owner_id' => $this->owner->id,
'tax_percentage' => $this->owner->taxPercentage() ?: 0,
'trial_ends_at' => $this->trialExpires,
'cycle_started_at' => $now,
'cycle_ends_at' => $this->nextPaymentAt,
]);