app/Http/Presenters/WorkOrder/WorkOrderSessionPresenter.php
public function tablePerWorker(WorkOrder $workOrder)
    {
        $sessions = $workOrder->getUniqueSessions();

        return $this->table->of('work-orders.sessions.per-worker', function (TableGrid $table) use ($sessions) {
            $table->with($sessions);

            $table->attributes([
                'class' => 'table table-hover table-striped',
            ]);

            $table->column('worker', function (Column $column) {
                $column->value = function (WorkOrderSession $session) {
                    return $session->user->fullname;
                };
            });

            $table->column('total_hours', function (Column $column) {
                $column->value = function (WorkOrderSession $session) {
                    return $session->total_hours;
                };
            });
        });
    }
public function tablePerWorker(WorkOrder $workOrder)
    {
        $sessions = $workOrder->getUniqueSessions();

        return $this->table->of('work-orders.sessions.per-worker', function (TableGrid $table) use ($sessions) {
            $table->with($sessions);

            $table->attributes([
                'class' => 'table table-hover table-striped',
            ]);

            $table->column('worker', function (Column $column) {
                $column->value = function (WorkOrderSession $session) {
                    return $session->user->fullname;
                };
            });

            $table->column('total_hours', function (Column $column) {
                $column->value = function (WorkOrderSession $session) {
                    return $session->total_hours;
                };
            });
        });
    }
Displays unique sessions per worker and totals their hours.

@param WorkOrder $workOrder

@return \Orchestra\Contracts\Html\Builder