Español →

Oliver Servín

How to keep in sync your customers details with Stripe in Laravel

There is a handy syncStripeCustomerDetails method available on Laravel Cashier for Stripe that lets you keep in sync your customers details.

So, when a customer updates their email or name details, it gets updated on Stripe too.

// App/Models/User.php
namespace App\Models;
use function Illuminate\Events\queueable;
class User extends Authenticatable
// ...
// listen for the updated User model event and invoke `syncStripeCustomerDetails`
protected static function booted()
static::updated(queueable(function ($customer) {

Code in action:

You can overwrite the attributes used to sync the information by adding the following methods stripeName, stripeEmail, stripePhone, and stripeAddress methods.

Interact with API result values as object properties in Laravel

Get relative path with `route()` in Laravel

Chokidar file watcher to auto-run Pest tests

Chaining "Where" conditions using dynamic methods

Model factories with relationships by using magic methods

Show amount to pay in next billing cycle with Laravel Cashier (Stripe)

Tax calculation with Laravel Cashier for Stripe

How to keep in sync your customers details with Stripe in Laravel

Handle Paddle's marketing consent with Laravel

Custom styling the pay button with Laravel Cashier Paddle

Embed Paddle's checkout widget with Laravel Cashier

Weekly auto-reset a Laravel demo app

Remove the personal_access_tokens table on a fresh Laravel App

Deploy Umami analytics with Launcher

Fix Laravel storage:link using Launcher

Launcher: first impressions

Integrating Tiptap in a Laravel-Livewire project

How to run a Ghost blog on Laravel Forge