Skip to content
Discussion options

You must be logged in to vote

Hey Matt!

Try this out, I am not sure if this is exactly what you are are trying to get.

    public function addColumns(): PowerGridEloquent
    {
        return PowerGrid::eloquent()
        ->addColumn('id_formatted', function (Model $model) {
            return '<a href="'.route('your_link_name_here', $model->id).'">'.$model->id.'</a>';
        })
    }
    public function columns(): array
    {
        return [
            Column::make('ID', 'id_formatted','id')
            ->sortable(),
    }

Hope this helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@matthewrichter
Comment options

Answer selected by matthewrichter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants