priMo-ex3m
priMo-ex3m

Reputation: 1092

Laravel Nova, change search results HTML

I have a simple Nova integration like this : Image

I want somehow to make the Name field to be an anchor. So, to make it a link the same way that view button does. Any ideas? (Nothing on docs)

Upvotes: 0

Views: 612

Answers (2)

priMo-ex3m
priMo-ex3m

Reputation: 1092

    Text::make('name')
        ->asHtml()
        ->displayUsing(function ($name) {
            return <a href="route('shops.show', $this->id)">{{$name}}</a>
        })

Upvotes: 3

r00t
r00t

Reputation: 466

Text::make('Name', function () {
    return '<a href="#">'.$this->name.'</a>';
})->asHtml()

Upvotes: 1

Related Questions