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

Oliver Servín
You can easily show how much a customer will pay in the next billing cycle with the upcomingInvoice
method in Laravel Cashier (Stripe) to get the upcoming invoice details.
// routes/web.php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
// ...
Route::get('/profile/invoices', function (Request $request) {
return view('/profile/invoices', [
'upcomingInvoice' => $request->user()->upcomingInvoice(),
'invoices' => $request-›user()->invoices(),
]);
});
