vendredi 1 mars 2019

I'm getting an empty var after I do a foreach in laravel

I get a empty result when really i should get 3500

 $transcationhist = Transcationhistorique::whereDate('created_at', Carbon::today())->pluck('ammount');

 $ammount = 0 ;

 foreach ($transcationhist as $p) {

    $ammount = $ammount + $p['ammount'];

 }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire