Skip to content

Commit

Permalink
Add url option on table columns.
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrkidn committed Jan 23, 2024
1 parent 38f49c9 commit 51de8dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Filament/RedirectResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Str;

class RedirectResource extends Resource
{
Expand Down Expand Up @@ -50,9 +51,11 @@ public static function table(Table $table): Table
return $table
->columns([
Tables\Columns\TextColumn::make('from')
->searchable(),
->searchable()
->url(fn ($record) => Str::replace('*', '', $record->from), true),
Tables\Columns\TextColumn::make('to')
->searchable(),
->searchable()
->url(fn ($record) => Str::replace('*', '', $record->to), true),
Tables\Columns\TextColumn::make('status'),
])
->filters([
Expand Down

0 comments on commit 51de8dc

Please sign in to comment.