Skip to content

Use relationship from one column to another column #904

Closed Answered by rubensrocha
rubensrocha asked this question in Q&A
Discussion options

You must be logged in to vote

I found a solution:

public function builder(): Builder
    {
        return Deposit::where('user_id', auth()->id())->with('currency')->select('currency.url as url');
    }
Column::make("TXID", "tx_id")
                ->sortable()
                ->searchable()
                ->format(function($value, $row, Column $column) {
                    if(isset($value)){
                        return '<a href="'.custom_function_here($row['url'], $value).'" target="_blank">'.$value.'</a>';
                    }
                })

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rubensrocha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant