Update 2/16/21 - This tutorial has been updated to include the recent Stripe Checkout support added to Laravel Cashier.
Laravel Jetstream is a gre...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks Chris, this was super helpful! The only problem I ran into is that when I changed those migrations, I got an error because the customers table was being created before the teams table, but I was able to fix that by just renaming the migration files so they went in the correct order. Full disclosure: I was doing this on an existing (new) project I started, so I expect I just didn't install Jetstream and Cashier in the same order you did.
Cheers!
In Laravel 11, I believe the middleware config would be in
bootstrap/app.php
You are not importing the Stripe JS library, so this tutorial will result in:
You can add the following to
resources/views/billing.blade.php
, above the<script>
tag:Good catch! I've added this.
Thanks, this was very helpful! A few notes:
sessions
table as Jetstreamcheckout.session.completed
handleFetchResult
, nothandleResult
?Thanks for your feedback, Alex! I have made updates to address the last two notes, but I'm not able to reproduce the
sessions
table error. 🤔Nice integration, for added flexibility, I added a way to select between multiple payment providers using service container and contextual binding. However I didn't know about jetstream, seems a nice solution to prevent inventing the wheel.
Chris, This is a very good article, but I must be missing something. I followed each of your steps and get the page below, but when I click on a button nothing happens. I would have expected it to go to stripe. Do I need to set something else up?
I wanted to add... At least nowadays, when you publish the migrations to switch to team_id for stripe, you will have to also rename your team migrations for jetstream to run first before the stripe migrations do
Also, I wish there was a tutorial for the inertia version of Jetstream as it seems like I can't get this setup completely. I get up to the part and then I'm stuck since the view and navigation dropdown files aren't the same, but I'll format them to what I have
Thank you!
Is it possible to start a subscription from the billing portal? In other words, the checkout is entirely handled by Stripe in their portal?
No, you can only manage existing subscriptions with the billing portal.
Interesting! Would be a nice feature for Stripe to add as it would remove the requirement for checkout and decouple billing entirely.
Thank you for the tutorial, very insightful.
For the installation I think this would work as well:
laravel new cool-project --jet --teams
Thanks! I've updated the tutorial to use the installer.
Great article! I’m having an issue with the model though… when I define it as the Team model in my .env, it still tries to user the User model and as a result it fails - any tips?
Is it possible to style the buttons? I'm not clear where that code is located.
Can we handle single parents with this as well? (Not subscriptions)