Create a MenuItem action on your TableMetricRow
Jul 17, 2023
2
Level 1
Nova Table Metric - HTML in title
All,
I have created a table metric and would like to link to a resource from the title of each entry in the table.
I currently have a calculate function that looks like this:
public function calculate(NovaRequest $request)
{
$leagueSeasons = LeagueSeason::where('start_date','>=',Carbon::now()->startOfDay())
->whereRelation('league','active',true)
->orderBy('start_date')
->get();
return $leagueSeasons->map(function($ls) {
$url = route('nova.pages.detail',['resource' => 'league-season','resourceId' => $ls->id]);
return MetricTableRow::make()
->icon('clock')
->iconClass('text-gray-400')
->title("<a href='$url'>{$ls->getDescription()}</a>")
->subtitle($ls->start_date->format('l jS F Y'));
})->toArray();
}
However, the HTML in the title of the MetricTableRow is escaped.
Any thoughts on how I could do this?
:wq
Level 14
Please or to participate in this conversation.