Column
class Column
Traits
Properties
| 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 |
| string | $label | ||
| string | $key | ||
| string | $index | ||
| bool | $isVisible | ||
| bool | $isHidden | ||
| bool | $hideFromSelector | ||
| Closure|null | $customData | ||
| string | $classes | ||
| string | $th_classes | ||
| string | $th_wrapper_classes | ||
| bool | $has_modified_data | ||
| bool | $hide_on_mobile | ||
| bool | $collapseOnMobile | ||
| bool | $show_on_mobile | ||
| bool | $cardTitle | ||
| Closure|null | $cardTitleCallback | ||
| bool | $triggerCardInfoModal | ||
| bool | $showOnCard | ||
| bool | $isEditable | ||
| string | $editableType | ||
| array | $editableOptions | ||
| callable|string|null | $editableCallback | ||
| callable|null | $sortableCallback | ||
| callable|null | $searchableCallback | ||
| Closure|null | $secondaryHeaderCallback | ||
| bool | $isSortable | ||
| bool | $isSearchable | ||
| static protected string[] | $existingKeys | ||
| string|null | $updateField |
Methods
Get a fresh collection of column instances with closures intact.
Resolve secondary header values by calling each column's callback with the current rows.
Set CSS classes for the column's header wrapper element.
Set a closure that determines when the toggle should be disabled.
Open the link in a popup window with the given dimensions.
Conditionally hide the column and remove it from the column selector.
Set an alternative column key to use when sorting this column.
Create a new Column instance.
Set the column to collapse on mobile devices.
Set the column as the card title for mobile devices.
Toggle whether clicking the card title opens the info modal.
Toggle whether this column is displayed on mobile cards.
Set a secondary header callback for this column.
Mark the column as searchable.
Mark the column as editable.
Set the database field to use when saving editable values.
Reset the static key registry (used between test runs).
Generate a unique slug key from the column label.
Details
in
Columns at line 53
void
setColumns()
Initialize and process column definitions.
Handles mobile visibility, collapse behavior, and strips closures for Livewire serialization.
in
Columns at line 99
Collection
getFreshColumns()
Get a fresh collection of column instances with closures intact.
in
Columns at line 114
array
resolveSecondaryHeaders(mixed $paginatedData)
Resolve secondary header values by calling each column's callback with the current rows.
in
Columns at line 136
void
showColumnToggle(bool $bool)
Show or hide the column toggle dropdown.
in
Columns at line 146
void
setColumnID(string $column_id)
Set the primary key column used to identify rows.
in
Columns at line 164
Columns
showOnMobile(bool $bool = true)
Show this column only on mobile devices.
in
Columns at line 176
Columns
view(string $view)
Set a custom Blade view for rendering the column cell.
in
Columns at line 187
Columns
styling(string $classes)
Set CSS classes for the column's table cell (td).
in
Columns at line 197
Columns
thStyling(string $classes)
Set CSS classes for the column's table header (th).
in
Columns at line 207
Columns
thWrapperStyling(string $classes)
Set CSS classes for the column's header wrapper element.
in
Columns at line 217
Columns
disableToggleWhen(Closure $function)
Set a closure that determines when the toggle should be disabled.
in
Columns at line 227
Columns
hideToggleWhen(Closure $function)
Set a closure that determines when the toggle should be hidden.
in
Columns at line 237
Columns
trigger(string $trigger)
Set the method name to call when a toggle column is toggled.
in
Columns at line 259
Columns
trueIs(mixed $true)
Set the value that represents "true" for boolean columns.
in
Columns at line 271
Columns
trueLabel(string $string)
Set the display label/icon for the "true" state.
in
Columns at line 283
Columns
falseLabel(string $string)
Set the display label/icon for the "false" state.
in
Columns at line 317
Columns
href(Closure $function)
Set a closure that resolves the URL for a link column.
in
Columns at line 329
Columns
target(string $target)
Set the target attribute for a link column (e.g. '_blank').
in
Columns at line 343
Columns
popup(array $array = ['width' => 750, 'height' => 800])
Open the link in a popup window with the given dimensions.
in
Columns at line 357
Columns
classes(string $classes)
Set CSS classes for a link column's anchor tag.
in
Columns at line 369
Columns
customData(Closure $function)
Set a closure to transform the column's display value.
in
Columns at line 379
Columns
hideWhen(bool $bool)
Conditionally hide the column and remove it from the column selector.
in
Columns at line 392
Columns
hideFromSelector(bool $bool)
Hide this column from the column toggle selector.
in
Columns at line 412
Columns
sortColumnBy(string $column)
Set an alternative column key to use when sorting this column.
at line 105
__construct(string $label, string|null $index = null)
Create a new Column instance.
at line 117
static Column
make(string $label, string|null $key = null)
static Constructor.
at line 125
Column
collapseOnMobile(bool $bool = true)
Set the column to collapse on mobile devices.
at line 137
Column
cardTitle(bool|callable $callback = true)
Set the column as the card title for mobile devices.
at line 152
Column
triggerCardInfoModal(bool $bool = true)
Toggle whether clicking the card title opens the info modal.
at line 162
Column
showOnCard(bool $bool = true)
Toggle whether this column is displayed on mobile cards.
at line 174
Column
sortable(bool|callable $callback = true)
Mark the column as sortable.
at line 194
Column
secondaryHeader(callable $callback)
Set a secondary header callback for this column.
The callback receives the current rows collection and should return the content to display in the secondary header cell.
at line 206
Column
searchable(bool|callable $callback = true)
Mark the column as searchable.
at line 225
Column
editable(string $type = 'input', array $options = [], callable|null $onUpdate = null)
Mark the column as editable.
at line 243
Column
setUpdateField(string $field)
Set the database field to use when saving editable values.
at line 253
Column
pushLeft()
Align the column content to the left.
at line 267
Column
pushRight()
Align the column content to the right.
at line 281
Column
centered()
Center the column content.
at line 297
static void
resetStaticKeys()
Reset the static key registry (used between test runs).
at line 305
protected string
generateUniqueKey(string $label)
Generate a unique slug key from the column label.