0

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)

thisiskelvin
  • 4,136
  • 1
  • 10
  • 17
priMo-ex3m
  • 1,072
  • 2
  • 15
  • 29

2 Answers2

3
    Text::make('name')
        ->asHtml()
        ->displayUsing(function ($name) {
            return <a href="route('shops.show', $this->id)">{{$name}}</a>
        })
priMo-ex3m
  • 1,072
  • 2
  • 15
  • 29
1
Text::make('Name', function () {
    return '<a href="#">'.$this->name.'</a>';
})->asHtml()
r00t
  • 468
  • 3
  • 10
  • 1
    Welcome to Stack Overflow! Thank you for the code snippet, which might provide some limited, immediate help. A proper explanation would greatly improve its [long-term value](https://meta.stackexchange.com/q/114762/206345) by describing why this is a good solution to the problem, and would make it more useful to future readers with other similar questions. Please edit your answer to add some explanation, including the assumptions you've made. – sepehr Oct 29 '18 at 16:07