https://laravel.com/docs/6.x/billing#creating-subscriptions
The documentation states this
->create($paymentMethod);
Yet you are sending in a token?
->create($token);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm getting that error when i post a payment from my app. I'm using stripe payment system and cashier.
My controller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SubscriptionController extends Controller
{
public function index()
{
return view('subscribe');
}
public function store(Request $request)
{
$token =$request->stripeToken;
auth()->user()->newSubscription('model','monthly')->create($token);
auth()->user()->assignRole('subscriber');
return redirect('/plan');
}
}
My View
@extends('layouts.app')
@section('post-js')
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h3>Subscribe to monthly plan</h3>
<form action="/subscribe" method="POST">
{{csrf_field()}}
<!-- <input type="text" name="coupon"> -->
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_PUYJMeO6wE9Y5iK8ca28ZJGS00Z6OhAZdo"
data-amount="0"
data-name="Exclusive Fans"
data-description="Subscribe to XclusiveFans"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-label="Subscribe Now"
data-email="{{ auth()->check()?auth()->user()->email: null}}"
data-panel-label="Pay Monthly"
data-locale="auto">
</script>
</form>
</div>
</div>
</div>
@endsection
My route
Route::get('/subscribe','SubscriptionController@index');
Route::post('/subscribe','SubscriptionController@store');
@tomasosho I know that the documentation for Cashier is not a step by step guide on how to integrate everything with Stripe, but following both the Stripe documentation and Cashier will get you very far.
So first you need to add a Payment Method on Stripe for the user, here is a project that I created to showcase on how to do that, it was done for another question here on Laracasts:
Then as the documentation says, you need to create a subscription using that payment method:
But first the subscription plan has to exist in your Stripe account as well, for that checkout this documentation
https://stripe.com/docs/billing/subscriptions/products-and-plans#using-the-dashboard
There is a video for this here on Laracasts as well
https://laracasts.com/lessons/painless-subscriptions-with-laravel-and-stripe
It is for an older version, but you can get very far following the video and also reading the documentation.
So I know it is going back and forward a lot, but that's the job of a programmer :)
I hope this was helpful, let me know if you get any step closer with what I've shown you above.
Please or to participate in this conversation.