Skip to content

Using multiple datafields in one column? #2192

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

You must be logged in to vote

Understood the builder method more and am using it like this:

public function builder(): Builder { return ContractAgent::query() ->select([ 'id', 'email', 'contract_agent_phone', ]); }

public function configure(): void { $this->setPrimaryKey('id'); }

public function columns(): array { return [ Column::make("Contact", "email") ->format( fn ($value, $row, Column $col) => '<i class="bi bi-phone"></i>' . $row->contract_agent_phone . '<br>' . '<i class="bi bi-envelope-at"></i> <a href="mailto:' . $row->email . '" target="_blank">' . $row->email . '</a>' ) ->html(), ]; }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dermicha56
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