ArtiGrid
v1.6

Group By

The groupby() method allows you to group records in the grid based on one or more columns.

This is useful for organizing data in a more structured way, especially when working with repeated values such as customers, categories, or related records.

You can pass one or multiple fields as an array to define how the data should be grouped.


<?php
    $grid = new ArtiGrid();
    $grid->table('payments')
        ->template('bootstrap5')
        ->groupby(['customerNumber'])
        ->formFields(['customerNumber','checkNumber', 'amount'])
        ->modal();
    echo $grid->render();
?>
paymentId customerNumber checkNumber paymentDate amount Actions