I have a problem when i make a query in blade laravel 5
@foreach($dates_chart_debit as $date)
<?php
$result = DB::table('productions')
->join('durees', 'productions.duree_id', '=', 'durees.id')
->where(DB::raw("Date(productions.date)") ,"=",$date)
->where('productions.puit_id' ,"=",1)
->where(DB::raw("durees.isInReport") ,"=",'1')
->where('final_validation' ,"=",'1')
->select(DB::raw("sum(debit) as debit"))->first()->get();
?>
{{$result->debit}}
@endforeach
it gives me an error message like
Object of class stdClass could not be converted to string (View: C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\projects\Coil\resources\views\panel\chart\executive.blade.php)
and what is the best way to do that
$date
? – Jerodev