Beartropy Tables
BoolColumn
Renders boolean values as checkmark/cross icons.
BoolColumn
trueIs(mixed $value) — Define what value equals true (strict comparison).
trueLabel(string $label) / falseLabel(string $label) — Customize the display for each state.
1BoolColumn::make('User status','isActive')2 ->trueIs('enabled')3 ->trueLabel('User Active')4 ->falseLabel('<i class="icon"></i>')
DateColumn
Handles date formatting with input/output format control.
DateColumn
inputFormat(string $format) — The expected date format from your data source.
outputFormat(string $format) — The display format (default: Y-m-d).
emptyValue(string $value) — Fallback text when the date is null or empty.
1DateColumn::make('Created At', 'created_at')2 ->inputFormat('Y-m-d H:i:s')3 ->outputFormat('M d, Y')4 ->emptyValue('Not Found')
LinkColumn
Generates a clickable link from column data.
LinkColumn
text(string|Closure $text) — Set the link text.
href(Closure $callback) — Generate the URL dynamically.
target(string $target) — Set the link target (e.g., _blank).
classes(string $classes) — Add CSS classes to the link.
popup(array $options) — Open in a popup window with width and height options.
1LinkColumn::make('Edit user','id')2 ->text('Edit')3 ->href(function($row, $value){4 return '/edit/'.$value;5 })
ToggleColumn
Renders a toggle switch that triggers a Livewire method on click.
ToggleColumn
The method receives ($id, $column) as parameters.
1// Will trigger the 'myCustomLivewireMethod($id, $column)' method on the component2ToggleColumn::make('Active','is_active')3 ->trigger('myCustomLivewireMethod')
Complete Example
A playground table showcasing all column types in a single component.
ColumnTypesTable.php
This example combines Column, BoolColumn, DateColumn, LinkColumn, ToggleColumn, and an editable column in one table.
1use App\Models\User; 2use Beartropy\Tables\Classes\Columns\BoolColumn; 3use Beartropy\Tables\Classes\Columns\Column; 4use Beartropy\Tables\Classes\Columns\DateColumn; 5use Beartropy\Tables\Classes\Columns\LinkColumn; 6use Beartropy\Tables\Classes\Columns\ToggleColumn; 7use Beartropy\Tables\YATBaseTable; 8 9class ColumnTypesTable extends YATBaseTable10{11 public $model = User::class;12 13 public function columns(): array14 {15 $emailLink = LinkColumn::make('Email Link', 'email');16 $emailLink->href = fn ($row) => 'mailto:' . ($row['email'] ?? $row->email ?? '');17 18 return [19 Column::make('Name', 'name')20 ->sortable()21 ->searchable(),22 23 BoolColumn::make('Verified', 'email_verified_at'),24 25 DateColumn::make('Created', 'created_at')26 ->outputFormat('M d, Y'),27 28 $emailLink,29 30 ToggleColumn::make('Active', 'email_verified_at'),31 32 Column::make('Editable Name', 'name')33 ->editable(),34 35 Column::make('ID', 'id')36 ->pushRight(),37 ];38 }39 40 public function settings(): void41 {42 $this->setPerPageDefault(10);43 }44}
Live Demo
Try it — sort columns, edit the Role select, and explore all column types.
Column Types Table
1<livewire:tables.demos.demo-column-types-table />