class YATBaseTable extends Component

Base Table Component.

This component serves as the foundation for all Beartropy Tables. It integrates various traits to provide functionality such as sorting, filtering, pagination, and bulk actions.

Traits

Properties

string $cachePrefix

Cache prefix used in the Data trait scope.

from  Data
int|null $cacheTimeStamp

Timestamp of the cached data.

from  Cache
int|null $all_data_count

Total count of all data records (before filtering).

from  Data
int|null $filtered_data_count

Count of data records after filtering.

from  Data
string $column_id

The unique identifier column for rows.

from  Columns
string $custom_column_id

A custom column ID override.

from  Columns
Collection|null $columns

Collection of defined columns.

from  Columns
bool $show_column_toggle

Whether to show the column toggle dropdown.

from  Columns
bool $column_toggle_dd_status

Status of the column toggle dropdown (open/closed).

from  Columns
bool $hasMobileCollapsedColumns

Indicates if there are columns collapsed on mobile view.

from  Columns
array $mobileCollapsedColumns

Array of columns that are collapsed on mobile.

from  Columns
bool $has_bulk

Indicates if the table has bulk actions enabled.

from  Bulk
(int|string)[] $yat_selected_checkbox

Array of selected row IDs for bulk actions.

from  Bulk
bool $selectAll

Controls the "Select All" checkbox state.

from  Bulk
bool $pageSelected

Indicates if the current page is selected.

from  Bulk
bool $allSelected

Indicates if all data (across all pages) is selected.

from  Bulk
$yat_global_search from  Search
string|null $yat_global_search_label from  Search
bool $useGlobalSearch from  Search
string $paginationTheme

The pagination theme to use (e.g. 'tailwind', 'bootstrap').

from  Pagination
int|string $perPage

Number of items per page.

from  Pagination
string $perPageDisplay

Display value for per page selector.

from  Pagination
string[] $perPageOptions

Available options for items per page.

from  Pagination
bool $with_pagination

Indicates if pagination is enabled.

int|null $currentPageNumber

Current page number.

from  Pagination
int|false $forcePageNumber

Force a specific page number.

from  Pagination
string|null $sortColumn from  Sort
string $sortDirection from  Sort
array $options

Options available for the table (e.g. for select filters or other UI elements).

from  Options
$handle_state from  StateHandler
$handler_prefix from  StateHandler
array $yatable_expanded_rows from  RowManipulators
bool $yatable_expanded_rows_is_component from  RowManipulators
array $yatable_expanded_rows_content from  RowManipulators
string|null $title from  View
string|null $titleClasses from  View
string|null $customHeader from  View
string|null $main_wrapper_classes from  View
string|null $table_classes from  View
bool $override_table_classes from  View
bool $sticky_header from  View
bool $has_counter from  View
string|null $modals_view from  View
string|null $yat_most_left_view from  View
string|null $yat_less_left_view from  View
string|null $yat_most_right_view from  View
string|null $yat_less_right_view from  View
bool $showCardsOnMobile from  View
bool $useCards from  View
bool $yat_is_mobile from  View
array $yat_custom_buttons from  View
string $yat_button_variant from  View
string $theme from  View
string|null $bulkThemeOverride from  View
string|null $buttonThemeOverride from  View
string|null $inputThemeOverride from  View
array $themeConfig from  View
array $yat_card_modal_buttons from  View
$mobileDetailsModalOpen from  View
$mobileDetailsRow from  View
$showOptionsOnlyOnRowSelect from  View
string|null $layout

The layout to be used for rendering the table.

$stripRows from  View
Collection|array $filters

Collection of defined filters.

from  Filters
bool $has_filters from  Filters
bool $show_filters from  Filters
string $trigger_spinner

Actions that trigger the loading spinner.

from  Spinner
bool $loading_table_spinner from  Spinner
string|null $loading_table_spinner_custom_view from  Spinner
mixed $model

The model or builder instance used for the table data.

array $with

An array of relationships to eager load.

Methods

void
setCachePrefix(string $string)

Set the cache prefix.

from  Cache
string
getCacheKey()

Generate a unique cache key for the current user and table.

from  Cache
void
cacheData()

Cache the current user data.

from  Cache
void
clearData()

Clear the cached data for this table.

from  Cache
mixed
getCachedData()

Retrieve cached data.

from  Cache
void
updateCacheData(mixed $data)

Update the cached data with new data.

from  Cache
Collection
stripModifiedRows(Collection $collection)

Strip modified row internal keys from the collection.

from  Data
Collection
getAllOriginalData()

Get all original data without modifications.

from  Data
Collection
getAllData()

Get all data available to the table.

from  Data
Collection
getAfterFiltersOriginalData()

Get original data after filters are applied.

from  Data
Collection
getAfterFiltersData()

Get data after applying search, filters, and sorting.

from  Data
Collection
getSelectedOriginalData()

Get selected original data without modifications.

from  Data
Collection
getSelectedData()

Get selected rows data.

from  Data
mixed|null
getRowByID(mixed $id)

Get a single row by its ID.

from  Data
Collection
getCurrentPageData()

Get data for the current page.

from  Data
void
parseData()

Parse and cache the initial data.

from  Data
Collection
processCollection(Collection $collection)

Process a collection of rows.

from  Data
array
transformRow(mixed $row, array $customData, array $linkColumns, array $toggleColumns)

Transform a single row.

from  Data
array
getCustomData()

Get columns with custom data closure.

from  Data
array
getLinkColumns()

Get columns configured as links.

from  Data
array
getToggleColumns()

Get columns with toggle functionality.

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

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

from  Data
setColumns()

No description

from  Columns
getFreshColumns()

No description

from  Columns
showColumnToggle(bool $bool)

No description

from  Columns
setColumnID(string $column_id)

No description

from  Columns
hideOnMobile(bool $bool)

No description

from  Columns
showOnMobile(bool $bool = true)

No description

from  Columns
view($view)

No description

from  Columns
styling(string $classes)

No description

from  Columns
thStyling(string $classes)

No description

from  Columns
thWrapperStyling(string $classes)

No description

from  Columns
disableToggleWhen(Closure $function)

No description

from  Columns
hideToggleWhen(Closure $function)

No description

from  Columns
trigger(string $trigger)

No description

from  Columns
isBool()

No description

from  Columns
trueIs($true)

No description

from  Columns
trueLabel($string)

No description

from  Columns
falseLabel($string)

No description

from  Columns
toHtml()

No description

from  Columns
text($text)

No description

from  Columns
href(Closure $function)

No description

from  Columns
target(string $target)

No description

from  Columns
popup(array $array = ["width" => 750, "height" => 800])

No description

from  Columns
classes($classes)

No description

from  Columns
customData(Closure $function)

No description

from  Columns
hideWhen(bool $bool)

No description

from  Columns
hideFromSelector(bool $bool)

No description

from  Columns
isVisible(bool $bool)

No description

from  Columns
sortColumnBy(string $column)

No description

from  Columns
void
emptySelection()

Clear the current selection.

from  Bulk
void
hasBulk(bool $bool)

Enable or disable bulk actions.

from  Bulk
void
updatedSelectAll(bool $value)

Handle updates to the "Select All" checkbox.

from  Bulk
void
selectCurrentPage(bool $value)

Select all rows on the current page.

from  Bulk
void
select_all_data(bool $value)

Select all rows across all pages (after filters).

from  Bulk
(int|string)[]
getSelectedRows()

Get the list of selected row IDs.

from  Bulk
void
useGlobalSearch(bool $status = true)

Enable or disable global search.

from  Search
void
setSearchLabel(string $label)

Set the label for the global search input.

from  Search
void
updatingSearch()

Handle updates to the global search input.

from  Search
Collection
filteredData()

Filter the data based on global search (Array mode).

from  Search
Builder
applySearchToQuery(Builder $query)

Apply global search to the Eloquent query.

from  Search
void
updatedPerPageDisplay(string|int $value)

Update the per-page display value.

void
usePagination(bool $bool)

Enable or disable pagination.

void
setPerPageDefault(int $number)

Set the default items per page.

void
setPerPageOptions(array $array)

Set available per-page options.

LengthAwarePaginator
paginateData()

specific method to handle pagination logic.

LengthAwarePaginator
getPageData(int $currentPage)

Get paginated data for a specific page number.

void
setSortDirectionAsc(bool $bool)

Set sort direction to ascending.

from  Sort
void
setSortDirectionDesc(bool $bool)

Set sort direction to descending.

from  Sort
void
setSortColumn(string $column)

Set the column to sort by.

from  Sort
void
sortBy(string $column)

Toggle sorting for a specific column.

from  Sort
Collection
sortData(Collection $data)

Sort the data collection (Array mode).

from  Sort
Builder
applySortToQuery(Builder $query)

Apply sorting to the Eloquent query.

from  Sort
void
setOptions()

Initialize and normalize options.

from  Options
useStateHandler(bool $bool)

No description

setHandlerPrefix(string $string)

No description

saveTableState()

No description

setTableState()

No description

void
removeRowFromTable(mixed $id, bool $resetSelected = true)

Remove a row from the table data (and cache).

void
addRowToTable(array $row)

Add a new row to the table data (and cache).

void
toggleExpandedRow(mixed $rowId, mixed $content, bool $is_component = false)

Toggle the expansion state of a row.

void
updateRowOnTable(mixed $id, array $newData)

Update a row's data in the table (and cache).

void
expandMobileRow(mixed $rowId)

Expand the mobile details view for a row.

void
toggleBoolean(mixed $id, string $column)

Toggle a boolean column value for a row.

void
setTheme(string $theme)

Set the table theme.

from  View
array
getThemeConfig(string $theme)

Get configuration for a specific theme from presets.

from  View
void
setBulkThemeOverride(string|null $theme)

Override the bulk actions theme.

from  View
void
setButtonThemeOverride(string|null $theme)

Override the button theme.

from  View
void
setInputThemeOverride(string|null $theme)

Override specific theme settings.

from  View
void
mountView()

Initialize view settings.

from  View
void
gatherEnvData()

Detect environmental data (e.g. mobile device).

from  View
void
addButtons(array $buttons)

Add custom buttons to the table header.

from  View
void
addCardModalButtons(array $buttons)

Add buttons to the card modal view.

from  View
void
showCounter(bool $bool)

Toggle the record counter display.

from  View
showCardsOnMobile(bool $bool = true)

No description

from  View
useCards(bool $bool = true)

No description

from  View
void
openMobileCardDetails(mixed $rowId)

Open the mobile details modal for a specific row.

from  View
void
closeMobileCardDetails()

Close the mobile details modal.

from  View
void
setTitle(string $title)

Set the table title.

from  View
void
overrideTitleClasses(string $classes)

Override default title classes.

from  View
void
setCustomHeader(string $html)

Set custom HTML content for the header.

from  View
void
setComponentClasses(string $classes)

Set CSS classes for the main component wrapper.

from  View
void
addTableClasses(string $classes)

Add CSS classes to the table element.

from  View
void
setTableClasses(string $classes)

Set (overwrite) CSS classes for the table element.

from  View
void
setStickyHeader()

Enable sticky header for the table.

from  View
void
setModalsView(string $view)

Set the view for modals.

from  View
void
setMostLeftView(string $view)

Set the view for the leftmost header area.

from  View
void
setLessLeftView(string $view)

Set the view for the inner left header area.

from  View
void
setMostRightView(string $view)

Set the view for the rightmost header area.

from  View
void
setLessRightView(string $view)

Set the view for the inner right header area.

from  View
void
setButtonVariant(string $variant)

Set the button variant style.

from  View
void
showOptionsOnlyOnRowSelect(bool $value = true)

Configure options visibility based on row selection specific logic.

from  View
void
setLayout(mixed $layout)

Set the main layout view.

from  View
void
stripRows(bool $strip = true)

Enable or disable striped rows.

from  View
string
getRowStripingClasses()

Get the CSS classes for row striping based on configuration.

from  View
void
setFilters()

Initialize filters.

from  Filters
string
getColumnKey(string $filter_label)

Identify the column key from a filter label.

from  Filters
void
updatedFilters(string $key, mixed $value)

Handle updates to filter inputs.

from  Filters
Collection
applyFilters(Collection $data)

Apply filters to the data collection (Array/Collection mode).

from  Filters
Collection
getFreshFilters()

Get a fresh instance of filters with current state merged.

from  Filters
Builder
applyFiltersToQuery(Builder $query)

Apply filters to the Eloquent query.

from  Filters
void
clearAllFilters(bool $selectAll = false)

Clear all active filters and search.

from  Filters
void
useTableSpinner(bool $bool)

Enable or disable the table loading spinner.

from  Spinner
void
setTableSpinnerView(string $view)

Set a custom view for the loading spinner.

from  Spinner
void
addTargetsToSpinner(array $targets)

Add more triggers (methods/properties) to the spinner.

from  Spinner
bool|void
updateField(mixed $id, string $field, mixed $value)

Update a specific field for a row.

from  Editable
void
refresh()

Refresh the table component.

void
mount()

Initialize the component.

void
showOnlyTable(bool $status = true)

Configure the table display mode.

View
render()

Render the component.

Details

in Cache at line 31
void setCachePrefix(string $string)

Set the cache prefix.

Parameters

string $string

The prefix string.

Return Value

void

in Cache at line 41
protected string getCacheKey()

Generate a unique cache key for the current user and table.

Return Value

string

in Cache at line 54
void cacheData()

Cache the current user data.

Stores the data in the cache for 60 minutes and updates the timestamp.

Return Value

void

in Cache at line 68
void clearData()

Clear the cached data for this table.

Return Value

void

in Cache at line 80
mixed getCachedData()

Retrieve cached data.

If cache is missing, it attempts to re-initialize the component (mount).

Return Value

mixed

The cached data.

in Cache at line 96
void updateCacheData(mixed $data)

Update the cached data with new data.

Clears current selection and updates the cache with the new data set.

Parameters

mixed $data

The new data to cache.

Return Value

void

in Data at line 64
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

in Data at line 90
Collection getAllOriginalData()

Get all original data without modifications.

Return Value

Collection

in Data at line 109
Collection getAllData()

Get all data available to the table.

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

Return Value

Collection

in Data at line 132
Collection getAfterFiltersOriginalData()

Get original data after filters are applied.

Return Value

Collection

in Data at line 147
Collection getAfterFiltersData()

Get data after applying search, filters, and sorting.

Return Value

Collection

in Data at line 189
Collection getSelectedOriginalData()

Get selected original data without modifications.

Return Value

Collection

in Data at line 199
Collection getSelectedData()

Get selected rows data.

Return Value

Collection

in Data at line 228
mixed|null getRowByID(mixed $id)

Get a single row by its ID.

Parameters

mixed $id

Return Value

mixed|null

in Data at line 265
Collection getCurrentPageData()

Get data for the current page.

Return Value

Collection

in Data at line 285
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

in Data at line 311
Collection processCollection(Collection $collection)

Process a collection of rows.

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

Parameters

Collection $collection

Return Value

Collection

in Data at line 382
array transformRow(mixed $row, array $customData, array $linkColumns, array $toggleColumns)

Transform a single row.

Parameters

mixed $row

The row object or array.

array $customData
array $linkColumns
array $toggleColumns

Return Value

array

The transformed row data.

in Data at line 478
array getCustomData()

Get columns with custom data closure.

Return Value

array

in Data at line 496
array getLinkColumns()

Get columns configured as links.

Return Value

array

in Data at line 516
array getToggleColumns()

Get columns with toggle functionality.

Return Value

array

in Data at line 542
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

in Columns at line 60
setColumns()

No description

in Columns at line 99
getFreshColumns()

No description

in Columns at line 107
showColumnToggle(bool $bool)

No description

Parameters

bool $bool

in Columns at line 112
setColumnID(string $column_id)

No description

Parameters

string $column_id

in Columns at line 117
Columns hideOnMobile(bool $bool)

No description

Parameters

bool $bool

Return Value

Columns

in Columns at line 123
Columns showOnMobile(bool $bool = true)

No description

Parameters

bool $bool

Return Value

Columns

in Columns at line 129
Columns view($view)

No description

Parameters

$view

Return Value

Columns

in Columns at line 136
Columns styling(string $classes)

No description

Parameters

string $classes

Return Value

Columns

in Columns at line 142
Columns thStyling(string $classes)

No description

Parameters

string $classes

Return Value

Columns

in Columns at line 148
Columns thWrapperStyling(string $classes)

No description

Parameters

string $classes

Return Value

Columns

in Columns at line 154
Columns disableToggleWhen(Closure $function)

No description

Parameters

Closure $function

Return Value

Columns

in Columns at line 159
Columns hideToggleWhen(Closure $function)

No description

Parameters

Closure $function

Return Value

Columns

in Columns at line 165
Columns trigger(string $trigger)

No description

Parameters

string $trigger

Return Value

Columns

in Columns at line 171
Columns isBool()

No description

Return Value

Columns

in Columns at line 177
Columns trueIs($true)

No description

Parameters

$true

Return Value

Columns

in Columns at line 183
Columns trueLabel($string)

No description

Parameters

$string

Return Value

Columns

in Columns at line 189
Columns falseLabel($string)

No description

Parameters

$string

Return Value

Columns

in Columns at line 195
Columns toHtml()

No description

Return Value

Columns

in Columns at line 201
Columns text($text)

No description

Parameters

$text

Return Value

Columns

in Columns at line 209
Columns href(Closure $function)

No description

Parameters

Closure $function

Return Value

Columns

in Columns at line 217
Columns target(string $target)

No description

Parameters

string $target

Return Value

Columns

in Columns at line 225
Columns popup(array $array = ["width" => 750, "height" => 800])

No description

Parameters

array $array

Return Value

Columns

in Columns at line 233
Columns classes($classes)

No description

Parameters

$classes

Return Value

Columns

in Columns at line 241
Columns customData(Closure $function)

No description

Parameters

Closure $function

Return Value

Columns

in Columns at line 247
Columns hideWhen(bool $bool)

No description

Parameters

bool $bool

Return Value

Columns

in Columns at line 256
Columns hideFromSelector(bool $bool)

No description

Parameters

bool $bool

Return Value

Columns

in Columns at line 262
Columns isVisible(bool $bool)

No description

Parameters

bool $bool

Return Value

Columns

in Columns at line 268
Columns sortColumnBy(string $column)

No description

Parameters

string $column

Return Value

Columns

in Bulk at line 49
void emptySelection()

Clear the current selection.

Resets the selected checkboxes and the "select all" state.

Return Value

void

in Bulk at line 61
void hasBulk(bool $bool)

Enable or disable bulk actions.

Parameters

bool $bool

Return Value

void

in Bulk at line 74
void updatedSelectAll(bool $value)

Handle updates to the "Select All" checkbox.

This method is triggered by Livewire when $selectAll property changes.

Parameters

bool $value

The new value of the checkbox.

Return Value

void

in Bulk at line 86
void selectCurrentPage(bool $value)

Select all rows on the current page.

Parameters

bool $value

If true, selects all rows on the current page. If false, deselects them.

Return Value

void

in Bulk at line 101
void select_all_data(bool $value)

Select all rows across all pages (after filters).

Parameters

bool $value

If true, selects all matching rows. If false, clears selection.

Return Value

void

in Bulk at line 126
(int|string)[] getSelectedRows()

Get the list of selected row IDs.

Return Value

(int|string)[]

in Search at line 29
void useGlobalSearch(bool $status = true)

Enable or disable global search.

Parameters

bool $status

Return Value

void

in Search at line 40
void setSearchLabel(string $label)

Set the label for the global search input.

Parameters

string $label

Return Value

void

in Search at line 52
void updatingSearch()

Handle updates to the global search input.

Resets pagination when search query changes.

Return Value

void

in Search at line 62
Collection filteredData()

Filter the data based on global search (Array mode).

Return Value

Collection

in Search at line 100
Builder applySearchToQuery(Builder $query)

Apply global search to the Eloquent query.

Parameters

Builder $query

Return Value

Builder

in Pagination at line 66
void updatedPerPageDisplay(string|int $value)

Update the per-page display value.

Handles the 'Total' option to show all records. Resets selection when page size changes.

Parameters

string|int $value

Return Value

void

in Pagination at line 87
void usePagination(bool $bool)

Enable or disable pagination.

Parameters

bool $bool

Return Value

void

in Pagination at line 98
void setPerPageDefault(int $number)

Set the default items per page.

Parameters

int $number

Passing 0 sets it to 'Total' (all items).

Return Value

void

in Pagination at line 115
void setPerPageOptions(array $array)

Set available per-page options.

Parameters

array $array

Return Value

void

in Pagination at line 128
LengthAwarePaginator paginateData()

specific method to handle pagination logic.

Applies search, filters, and sort logic to the query or collection, then paginates the result.

Return Value

LengthAwarePaginator

in Pagination at line 198
LengthAwarePaginator getPageData(int $currentPage)

Get paginated data for a specific page number.

Used for array-based data sources where we slice the collection manually.

Parameters

int $currentPage

Return Value

LengthAwarePaginator

in Sort at line 24
void setSortDirectionAsc(bool $bool)

Set sort direction to ascending.

Parameters

bool $bool

Return Value

void

in Sort at line 37
void setSortDirectionDesc(bool $bool)

Set sort direction to descending.

Parameters

bool $bool

Return Value

void

in Sort at line 50
void setSortColumn(string $column)

Set the column to sort by.

Parameters

string $column

Return Value

void

in Sort at line 61
void sortBy(string $column)

Toggle sorting for a specific column.

Parameters

string $column

Return Value

void

in Sort at line 88
Collection sortData(Collection $data)

Sort the data collection (Array mode).

Parameters

Collection $data

Return Value

Collection

in Sort at line 142
Builder applySortToQuery(Builder $query)

Apply sorting to the Eloquent query.

Handles relationship sorting and custom callbacks.

Parameters

Builder $query

Return Value

Builder

in Options at line 22
void setOptions()

Initialize and normalize options.

Converts string options to ['label' => '...', 'icon' => null] format.

Return Value

void

in StateHandler at line 15
useStateHandler(bool $bool)

No description

Parameters

bool $bool

in StateHandler at line 19
setHandlerPrefix(string $string)

No description

Parameters

string $string

in StateHandler at line 23
saveTableState()

No description

in StateHandler at line 38
setTableState()

No description

in RowManipulators at line 32
void removeRowFromTable(mixed $id, bool $resetSelected = true)

Remove a row from the table data (and cache).

Parameters

mixed $id
bool $resetSelected

Whether to clear selection after removal.

Return Value

void

in RowManipulators at line 50
void addRowToTable(array $row)

Add a new row to the table data (and cache).

Parameters

array $row

Return Value

void

in RowManipulators at line 69
void toggleExpandedRow(mixed $rowId, mixed $content, bool $is_component = false)

Toggle the expansion state of a row.

Parameters

mixed $rowId
mixed $content

Content string or array if is_component is true.

bool $is_component

Whether the content points to a Livewire component.

Return Value

void

Exceptions

Exception

in RowManipulators at line 95
void updateRowOnTable(mixed $id, array $newData)

Update a row's data in the table (and cache).

Parameters

mixed $id
array $newData

Key-value pairs to update.

Return Value

void

in RowManipulators at line 113
void expandMobileRow(mixed $rowId)

Expand the mobile details view for a row.

Parameters

mixed $rowId

Return Value

void

in RowManipulators at line 139
void toggleBoolean(mixed $id, string $column)

Toggle a boolean column value for a row.

Dispatches trigger method if defined on the column.

Parameters

mixed $id
string $column

Column key.

Return Value

void

in View at line 125
void setTheme(string $theme)

Set the table theme.

Parameters

string $theme

Return Value

void

in View at line 137
array getThemeConfig(string $theme)

Get configuration for a specific theme from presets.

Parameters

string $theme

Return Value

array

in View at line 149
void setBulkThemeOverride(string|null $theme)

Override the bulk actions theme.

Parameters

string|null $theme

Return Value

void

in View at line 160
void setButtonThemeOverride(string|null $theme)

Override the button theme.

Parameters

string|null $theme

Return Value

void

in View at line 171
void setInputThemeOverride(string|null $theme)

Override specific theme settings.

Parameters

string|null $theme

Return Value

void

in View at line 181
void mountView()

Initialize view settings.

Return Value

void

in View at line 193
void gatherEnvData()

Detect environmental data (e.g. mobile device).

Return Value

void

in View at line 207
void addButtons(array $buttons)

Add custom buttons to the table header.

Parameters

array $buttons

Return Value

void

in View at line 223
void addCardModalButtons(array $buttons)

Add buttons to the card modal view.

Parameters

array $buttons

Return Value

void

in View at line 234
void showCounter(bool $bool)

Toggle the record counter display.

Parameters

bool $bool

Return Value

void

in View at line 239
showCardsOnMobile(bool $bool = true)

No description

Parameters

bool $bool

in View at line 244
useCards(bool $bool = true)

No description

Parameters

bool $bool

in View at line 258
void openMobileCardDetails(mixed $rowId)

Open the mobile details modal for a specific row.

Parameters

mixed $rowId

Return Value

void

in View at line 269
void closeMobileCardDetails()

Close the mobile details modal.

Return Value

void

in View at line 281
void setTitle(string $title)

Set the table title.

Parameters

string $title

Return Value

void

in View at line 292
void overrideTitleClasses(string $classes)

Override default title classes.

Parameters

string $classes

Return Value

void

in View at line 303
void setCustomHeader(string $html)

Set custom HTML content for the header.

Parameters

string $html

Return Value

void

in View at line 314
void setComponentClasses(string $classes)

Set CSS classes for the main component wrapper.

Parameters

string $classes

Return Value

void

in View at line 325
void addTableClasses(string $classes)

Add CSS classes to the table element.

Parameters

string $classes

Return Value

void

in View at line 336
void setTableClasses(string $classes)

Set (overwrite) CSS classes for the table element.

Parameters

string $classes

Return Value

void

in View at line 347
void setStickyHeader()

Enable sticky header for the table.

Return Value

void

in View at line 360
void setModalsView(string $view)

Set the view for modals.

Parameters

string $view

Return Value

void

in View at line 371
void setMostLeftView(string $view)

Set the view for the leftmost header area.

Parameters

string $view

Return Value

void

in View at line 382
void setLessLeftView(string $view)

Set the view for the inner left header area.

Parameters

string $view

Return Value

void

in View at line 393
void setMostRightView(string $view)

Set the view for the rightmost header area.

Parameters

string $view

Return Value

void

in View at line 404
void setLessRightView(string $view)

Set the view for the inner right header area.

Parameters

string $view

Return Value

void

in View at line 415
void setButtonVariant(string $variant)

Set the button variant style.

Parameters

string $variant

Return Value

void

in View at line 428
void showOptionsOnlyOnRowSelect(bool $value = true)

Configure options visibility based on row selection specific logic.

Parameters

bool $value

Return Value

void

in View at line 441
void setLayout(mixed $layout)

Set the main layout view.

Parameters

mixed $layout

Return Value

void

in View at line 454
void stripRows(bool $strip = true)

Enable or disable striped rows.

Parameters

bool $strip

Return Value

void

in View at line 464
string getRowStripingClasses()

Get the CSS classes for row striping based on configuration.

Return Value

string

in Filters at line 35
void setFilters()

Initialize filters.

Processes defined filters, resolving keys, options (for magic-select), and serializing them for Livewire.

Return Value

void

in Filters at line 154
string getColumnKey(string $filter_label)

Identify the column key from a filter label.

Parameters

string $filter_label

Return Value

string

Exceptions

Exception

in Filters at line 174
void updatedFilters(string $key, mixed $value)

Handle updates to filter inputs.

Triggered by Livewire when filter properties change.

Parameters

string $key
mixed $value

Return Value

void

in Filters at line 219
Collection applyFilters(Collection $data)

Apply filters to the data collection (Array/Collection mode).

Parameters

Collection $data

Return Value

Collection

in Filters at line 276
Collection getFreshFilters()

Get a fresh instance of filters with current state merged.

Re-initializes filters (e.g. to get closures back) and merges the Livewire state (inputs).

Return Value

Collection

in Filters at line 317
Builder applyFiltersToQuery(Builder $query)

Apply filters to the Eloquent query.

Parameters

Builder $query

Return Value

Builder

in Filters at line 416
void clearAllFilters(bool $selectAll = false)

Clear all active filters and search.

Parameters

bool $selectAll

Whether to select all data after clearing.

Return Value

void

in Spinner at line 29
void useTableSpinner(bool $bool)

Enable or disable the table loading spinner.

Parameters

bool $bool

Return Value

void

in Spinner at line 40
void setTableSpinnerView(string $view)

Set a custom view for the loading spinner.

Parameters

string $view

Return Value

void

in Spinner at line 51
void addTargetsToSpinner(array $targets)

Add more triggers (methods/properties) to the spinner.

Parameters

array $targets

Return Value

void

in Editable at line 21
bool|void updateField(mixed $id, string $field, mixed $value)

Update a specific field for a row.

Handles inline editing updates. Supports callbacks, Eloquent models, and array data. Dispatches 'table-field-updated' event.

Parameters

mixed $id

The row ID.

string $field

The field/column key to update.

mixed $value

The new value.

Return Value

bool|void

Returns true if successful, false otherwise.

at line 90
void refresh()

Refresh the table component.

This method acts as a listener for the 'refresh' event. It re-initializes the component by calling the mount method.

Return Value

void

at line 105
void mount()

Initialize the component.

This method prepares the environment, settings, columns, options, filters, and view configurations. If no model is provided, it attempts to parse and cache data.

Return Value

void

at line 129
void showOnlyTable(bool $status = true)

Configure the table display mode.

Helper to quickly enable or disable table-only view. Disabling "only table" enables global search, pagination, and column toggle.

Parameters

bool $status

Whether to show only the table (defaults to true).

Return Value

void

at line 143
View render()

Render the component.

Calculates the data to be displayed, applying sorting and filtering if pagination is not used. Returns the view with the row data.

Return Value

View

The rendered view.