Laravel 发票错误
Laravel invoice error
使用 Laravel 5.2,我正在生成一个发票列表,它适用于以下代码:
$owner = User::where("accountId",Auth::user()
->accountId)
->where("owner",1)
->first();
$invoices = $owner->invoices();
但是当我尝试下载发票时
return $this->owner->downloadInvoice($id, [
'vendor' => 'XXXXXXX',
'product' => 'XXXXXXX',
]);
我收到以下错误
FatalErrorException in 0aba430056a58a8038d61445deab8578 line 133: Call
to undefined method Laravel\Cashier\InvoiceItem::startDateString()
错误似乎来自收据模板中的这个块,但经过大量谷歌搜索后,我似乎找不到任何答案。
<!-- Display The Subscriptions -->
@foreach ($invoice->subscriptions() as $subscription)
<tr>
<td>Subscription ({{ $subscription->quantity }})</td>
<td>{{ $subscription->startDateString() }} - {{ $subscription->endDateString() }}</td>
<td>{{ $subscription->dollars() }}</td>
</tr>
@endforeach
有什么想法吗?
我认为发票模板来自 Laravel 的旧版本。我已将模板更新为:
@foreach ($invoice->subscriptions() as $subscription)
<tr>
<td>Subscription ({{ $subscription->quantity }})</td>
<td>{{ $subscription->startDate() }} - {{ $subscription->endDate() }}</td>
<td>{{ $subscription->total() }}</td>
</tr>
@endforeach
它似乎有效
使用 Laravel 5.2,我正在生成一个发票列表,它适用于以下代码:
$owner = User::where("accountId",Auth::user()
->accountId)
->where("owner",1)
->first();
$invoices = $owner->invoices();
但是当我尝试下载发票时
return $this->owner->downloadInvoice($id, [
'vendor' => 'XXXXXXX',
'product' => 'XXXXXXX',
]);
我收到以下错误
FatalErrorException in 0aba430056a58a8038d61445deab8578 line 133: Call to undefined method Laravel\Cashier\InvoiceItem::startDateString()
错误似乎来自收据模板中的这个块,但经过大量谷歌搜索后,我似乎找不到任何答案。
<!-- Display The Subscriptions -->
@foreach ($invoice->subscriptions() as $subscription)
<tr>
<td>Subscription ({{ $subscription->quantity }})</td>
<td>{{ $subscription->startDateString() }} - {{ $subscription->endDateString() }}</td>
<td>{{ $subscription->dollars() }}</td>
</tr>
@endforeach
有什么想法吗?
我认为发票模板来自 Laravel 的旧版本。我已将模板更新为:
@foreach ($invoice->subscriptions() as $subscription)
<tr>
<td>Subscription ({{ $subscription->quantity }})</td>
<td>{{ $subscription->startDate() }} - {{ $subscription->endDate() }}</td>
<td>{{ $subscription->total() }}</td>
</tr>
@endforeach
它似乎有效