Laravel Cashier is not saving stripe data to my DB after a user is created.
When I create a new user and then try to assign a subscription() to that user (or any other user for that matter) the data is being sent to Stripe approriately, as I can see the customer id, plan chosen, etc... But my database user stripe columns do not get updated in my database.
When I remove the code to create() a user and just subscribe a user, the data persists to the database like it should. It only doesn't work after I've created a new user THEN try to subscribe any user.
I'm using Jeffrey Way's Model Validation Package.
$user = $this->userModel->create($input);
if ($user->hasErrors()) {
throw new \Exception($user->getErrors());
}
$this->createStripeSubscription($user->id, $input['creditCardToken']);
private function createStripeSubscription($user_id, $token) {
//$this->userModel->find(1)->subscription('monthly')->create($token); // Doesn't work either
$this->userModel->find($user_id)->subscription('monthly')->create($token);
}
$user->save()
before creating the Stripe subscription ? – user2629998