これはおそらく非常に簡単な質問です。しかし、私は立ち往生しています。これは私がテーブルの最後コントローラの文字列の値をlaravelのビューに渡して出力する
public function totalBillc3()
{
$total = Collection::where('collector_id', '=', 3)->sum('package');
return View::make('users.collector3', compact('total',$total));
}
そして私は私が持っている
<tr>
<td colspan="4" class="noborders"></td>
<th class="text-right" scope="row">TOTAL</th>
<td class="text-right">{{ $total}}</td>
</tr>
を書かれているビュー内で印刷するビューの列の合計を渡すためにtryngています私のコントローラ機能です私のルート完全に設定が、エラーが
Undefined variable: total (View: /Volumes/G/zipbillingsoft.com/resources/views/users/collector3.blade.php). Please help.
表示方法は? –
'{{$ total}}'とまったく同じです。 –