如何在我的视图刀片模板中删除单词sum(total)

时间:2017-04-13 08:54:53

标签: php arrays laravel object blade

$cek = DB::table('temp_obat')
            ->selectRaw('sum(total)')
            ->where('pasien', $id)
            ->get();
$total = $cek;

return view ('buy/bayar',compact('pasien'));

enter image description here

如何删除视图刀片中的sum(total)字样?

1 个答案:

答案 0 :(得分:1)

试试这个:

$cek = DB::table('temp_obat')
        ->selectRaw('sum(total) as total')
        ->where('pasien', $id)
        ->get();

return view ('buy/bayar', ['cek', $cek]);

在模板中:

{{ $cek->total }}