Home
NexoPOS

Declare Custom Export Columns

When using the Crud columns, NexoPOS provides a basic export feature that uses the defined columns for exporting to CSV. However, you might need to define custom columns that don't appear on the table list, but that should appear on the exported CSV file.

This is possible thanks to the property "exportColumns". From there, you'll define the columns that will be available during exportation, either on the __construct method or any other method called from the __construct method.

<?php
namespace Modules\YourModule\Crud;

use App\Service\CrudService;

class CustomCrud extends CrudService
{
    public function __construct()
    {
        $this->exportColumns  = [
            'updated_at'  =>  [
                'label'   =>  __( 'Updated On' ),                
            ],
            // ... other columns here
        ];
    }
}