Linked Questions

Popular Questions

Laravel groupby just like costum group by pipes

Asked by At

i have a problem to foreach the key from group by laravel.

here is mycode :

$testing = \DB::table(\DB::raw($query))
        ->where('total.content_file_download','not like','% %')
        ->where('total.updated_at','!=','0000-00-00 00:00:00')
        ->groupBy('month')->map(function ($group) {
                          return ["data" => $group ];

and it return so well until i cant foreach the key

the return

how can i give an array name on the key so i can foreach them

i want to use foreach like:

<ion-grid *ngFor="let item of allgallery">
          <ion-col *ngFor="let element of | slice:0:limit; let i=index">
<img [src]="'assets/img/no-img.jpg'" (click)="goView(element)"/>

The result that i want is like:

Related Questions