how to set url to a route out of filament panels

hello i want to create a button which is linked to main page of website. how should i set the route in url()? i tried this :
TextColumn::make('status') ->label('عملیات') ->formatStateUsing( function ($state) { return 'مشاهده'; } ) ->color('primary') ->icon('heroicon-o-eye') ->iconColor('primary') ->url( function ($record) { route('main.preview_product', ['id' => $record->id]); } ) ->openUrlInNewTab()
but it goes to edit page of this record 😐
Solution:
```php TextColumn::make('status') ->label('عملیات') ->formatStateUsing(...
Jump to solution
2 Replies
Solution
toeknee
toeknee9mo ago
TextColumn::make('status')
->label('عملیات')
->formatStateUsing(
function ($state) {
return 'مشاهده';
}
)
->color('primary')
->icon('heroicon-o-eye')
->iconColor('primary')
->url(
function ($record) {
return route('main.preview_product', ['id' => $record->id]);
}
)
->openUrlInNewTab()
TextColumn::make('status')
->label('عملیات')
->formatStateUsing(
function ($state) {
return 'مشاهده';
}
)
->color('primary')
->icon('heroicon-o-eye')
->iconColor('primary')
->url(
function ($record) {
return route('main.preview_product', ['id' => $record->id]);
}
)
->openUrlInNewTab()
matin rajabi
matin rajabiOP8mo ago
thanks for replying👍 😃
Want results from more Discord servers?
Add your server