Are you passing the invoices variable through to your view?
if so, try doing
{{dd($invoices)}}
In your view, to ensure that the data being passed your view matches the structure you want to output.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all,
I'm fairly new to laravel so go easy on me!
I'm trying to get my head around Stripe but it seems I'm missing something as I can't quite get it to work.
I want to list all the previous invoices for the current user logged in, I can manage to grab the upcoming invoice fine but I'm struggling with previous list.
So in my controller I grab the previous using the code below, the JSON response is expected.
$invoices = \Stripe\Invoice::all(array("limit" => 3));
However in my view:
@foreach ($invoices as $invoice)
<tr>
<td>{{ $invoice->date }}</td>
<td>{{ $invoice->total }}</td>
</tr>
@endforeach
Doesn't show anything, I'm not entirely sure that I'm even querying the data right! I assume it's different if it's returning an array?
Hope someone can help before I jump out the window. :(
Finally solved this, seems almost simple now but here is what fixed it.
@foreach($invoices->data as $invoice)
<tr>
<td>{{ $invoice->date }}</td>
<td>{{ $invoice->amount_due }}</td>
@endforeach
Please or to participate in this conversation.