Hello! I wonder if anybody can help me with this.
I am running Laravel 5.2 and have just installed Laravel Cashier 6.0 and added my Stripe test api keys.
I am able to add a subscription with the following code in my Subscriptions Controller
$user->newSubscription('main', 'monthly')->create($request->stripeToken);
However I have tried using the cancel and swap methods and both a giving me FatalThrowableError in Model.php line 797: Class 'User' not found. I can't see any error is User.php and the rest of the sites which interacts with the User model works fine.
One thing I noticed was that I seem to be using the stripe API v1. As the url in their test log is /v1/customers/cus_ANxDjbcYhXtnPw/subscriptions. Is this correct? Is there somewhere in Cashier where I can set the version of the API?
My update method looks like this.
public function update(Request $request)
{
$user = \Auth::user();
$user->subscription('main')->swap('yearly');
return redirect()->back();
}
And delete method looks like this:
public function cancel(Request $request)
{
$user = \Auth::user();
$user->subscription('main')->cancel();
return redirect()->back();
}
Both giving me the User not found error. But creating a subscription and viewing invoices works fine.
I appreciate this isn't much info but any help will be really appreciated! If there's more info I could give just ask.
Thanks
Ralph