trait Data

Properties

string $cachePrefix

Cache prefix used in the Data trait scope.

int|null $all_data_count

Total count of all data records (before filtering).

int|null $filtered_data_count

Count of data records after filtering.

Methods

Collection
stripModifiedRows(Collection $collection)

Strip modified row internal keys from the collection.

Collection
getAllOriginalData()

Get all original data without modifications.

Collection
getAllData()

Get all data available to the table.

Collection
getAfterFiltersOriginalData()

Get original data after filters are applied.

Collection
getAfterFiltersData()

Get data after applying search, filters, and sorting.

Collection
getSelectedOriginalData()

Get selected original data without modifications.

Collection
getSelectedData()

Get selected rows data.

mixed|null
getRowByID(mixed $id)

Get a single row by its ID.

Collection
getCurrentPageData()

Get data for the current page.

void
parseData()

Parse and cache the initial data.

Collection
processCollection(Collection $collection)

Process a collection of rows.

array
transformRow(mixed $row, array $customData, array $linkColumns, array $toggleColumns, array $cardTitleCallbacks = [])

Transform a single row.

array
getColumnMetadata()

Get all column metadata in a single pass over getFreshColumns().

void
exportToClipboard(Collection $collection, bool $tabs = true)

Export the current table data to clipboard (CSV/TSV).

Details

at line 32
Collection stripModifiedRows(Collection $collection)

Strip modified row internal keys from the collection.

Removes keys ending with '_original' and potentially restores original values.

Parameters

Collection $collection

Return Value

Collection

at line 55
Collection getAllOriginalData()

Get all original data without modifications.

Return Value

Collection

at line 67
Collection getAllData()

Get all data available to the table.

Fetches from model/database if configured, or returns cached data.

Return Value

Collection

at line 83
Collection getAfterFiltersOriginalData()

Get original data after filters are applied.

Return Value

Collection

at line 93
Collection getAfterFiltersData()

Get data after applying search, filters, and sorting.

Return Value

Collection

at line 133
Collection getSelectedOriginalData()

Get selected original data without modifications.

Return Value

Collection

at line 143
Collection getSelectedData()

Get selected rows data.

Return Value

Collection

at line 166
mixed|null getRowByID(mixed $id)

Get a single row by its ID.

Parameters

mixed $id

Return Value

mixed|null

at line 188
Collection getCurrentPageData()

Get data for the current page.

Return Value

Collection

at line 210
void parseData()

Parse and cache the initial data.

Clears existing cache, resets pagination, and re-processes data from source. Dispatches events based on data availability.

Return Value

void

at line 236
Collection processCollection(Collection $collection)

Process a collection of rows.

Applies transformations (custom data, links, toggles) to each row.

Parameters

Collection $collection

Return Value

Collection

at line 274
array transformRow(mixed $row, array $customData, array $linkColumns, array $toggleColumns, array $cardTitleCallbacks = [])

Transform a single row.

Parameters

mixed $row

The row object or array.

array $customData
array $linkColumns
array $toggleColumns
array $cardTitleCallbacks

Return Value

array

The transformed row data.

at line 375
array getColumnMetadata()

Get all column metadata in a single pass over getFreshColumns().

Consolidates custom data, link columns, toggle columns, and card title callbacks to avoid iterating the column definitions multiple times.

Return Value

array

at line 428
void exportToClipboard(Collection $collection, bool $tabs = true)

Export the current table data to clipboard (CSV/TSV).

Parameters

Collection $collection
bool $tabs

If true, uses tabs (TSV); otherwise uses commas (CSV).

Return Value

void