Beartropy Tables
Data Accessors
The Data trait provides methods for accessing your dataset in various states — raw, filtered, or selected.
Available Methods
All Data
getAllOriginalData()— Complete dataset with raw database values.getAllData()— Complete dataset with formatting/accessors applied.
Filtered Data
getAfterFiltersOriginalData()— Data matching active filters with raw values.getAfterFiltersData()— Data matching active filters with formatting applied.
Selected Data
getSelectedOriginalData()— Only user-selected rows with raw values.getSelectedData()— Only user-selected rows with formatting applied.
Single Row & Export
getRowByID($id)— Retrieve a single row object by ID.exportToClipboard($collection, $tabs = true)— Copy data to clipboard as TSV (default) or CSV.
1// Original Data (Raw Values) 2$this->getAllOriginalData(); 3$this->getAfterFiltersOriginalData(); 4$this->getSelectedOriginalData(); 5 6// Formatted Data (With Accessors/Mutators) 7$this->getAllData(); 8$this->getAfterFiltersData(); 9$this->getSelectedData();10 11// Single Row12$this->getRowByID($id);13 14// Export15$this->exportToClipboard($collection, $tabs = true);
Original vs Formatted
customData and column transformations applied).
Clipboard Export
Copy table data directly to the user's clipboard.
Bulk Selection IDs
getSelectedRows() — Returns an array of IDs for all currently selected rows. Combine with data accessors for export workflows.
1// Get ID array of selected rows2$this->getSelectedRows();
Clipboard format
exportToClipboard() copies data as tab-separated values (TSV) by default — perfect for pasting into spreadsheets. Pass $tabs = false for CSV format.
Laravel Excel Integration
Automatic Excel and CSV export when Laravel Excel is installed.
Install Laravel Excel
If Laravel Excel is installed, Beartropy Tables automatically adds "Export to Excel" and "Export to CSV" options to your table's settings dropdown.
1composer require maatwebsite/excel
Zero configuration
exportToExcel() or exportToCsv() in your table component.