LinkColumn
class LinkColumn extends 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 | from Column | |
| string | $key | from Column | |
| string | $index | from Column | |
| bool | $isVisible | from Column | |
| bool | $isHidden | from Column | |
| bool | $hideFromSelector | from Column | |
| Closure|null | $customData | from Column | |
| string | $classes | from Column | |
| string | $th_classes | from Column | |
| string | $th_wrapper_classes | from Column | |
| bool | $has_modified_data | ||
| bool | $hide_on_mobile | from Column | |
| bool | $collapseOnMobile | from Column | |
| bool | $show_on_mobile | from Column | |
| bool | $cardTitle | from Column | |
| Closure|null | $cardTitleCallback | from Column | |
| bool | $triggerCardInfoModal | from Column | |
| bool | $showOnCard | from Column | |
| bool | $isEditable | from Column | |
| string | $editableType | from Column | |
| array | $editableOptions | from Column | |
| callable|string|null | $editableCallback | from Column | |
| callable|null | $sortableCallback | from Column | |
| callable|null | $searchableCallback | from Column | |
| Closure|null | $secondaryHeaderCallback | from Column | |
| bool | $isSortable | from Column | |
| bool | $isSearchable | from Column | |
| static protected string[] | $existingKeys | from Column | |
| string|null | $updateField | from Column | |
| bool | $isLink | ||
| mixed | $href | ||
| string|null | $text | ||
| string|null | $tag_styles |
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 LinkColumn 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 editable.
Set the database field to use when saving editable values.
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 39
__construct(string $label, string|null $key = null)
Create a new LinkColumn instance.
at line 47
static Column
make(string $label, string|null $key = null)
Static factory method.
in
Column at line 125
Column
collapseOnMobile(bool $bool = true)
Set the column to collapse on mobile devices.
in
Column at line 137
Column
cardTitle(bool|callable $callback = true)
Set the column as the card title for mobile devices.
in
Column at line 152
Column
triggerCardInfoModal(bool $bool = true)
Toggle whether clicking the card title opens the info modal.
in
Column at line 162
Column
showOnCard(bool $bool = true)
Toggle whether this column is displayed on mobile cards.
in
Column 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.
in
Column at line 206
Column
searchable(bool|callable $callback = true)
Mark the column as searchable.
in
Column at line 225
Column
editable(string $type = 'input', array $options = [], callable|null $onUpdate = null)
Mark the column as editable.
in
Column at line 243
Column
setUpdateField(string $field)
Set the database field to use when saving editable values.
in
Column at line 297
static void
resetStaticKeys()
Reset the static key registry (used between test runs).
in
Column at line 305
protected string
generateUniqueKey(string $label)
Generate a unique slug key from the column label.