Laravel Cashier Invoice Date Issue


April 2019


3 time


I am using Laravel 5.8 with Laravel Cashier. When I try to show a list of invoices of a user, I used this code:

@foreach (Auth::user()->invoices() as $invoice)
        <td>{{ $invoice->date()->toFormattedDateString() }}</td>
        <td>{{ $invoice->total() }}</td>
            <a href="/user/invoice/{{ $invoice->id }}">Download</a>

However, the line $invoice->date()->toFormattedDateString() gives an error:

DateTime::__construct(): Failed to parse time string (@) at position 0 (@): Unexpected character

It seems that the Invoice date is null. Are there other settings that I should follow? Downloading the invoice will also produce an error because of the Invoice date.

0 answers