Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nathangross's avatar

Linking front-end to edit resource instance in backend (Nova)

Is there a preferred way to handle generating a link to edit the instance of a resource?

For instance, I am on a post show view, and would like to be able to click a link to edit this post in Nova.

0 likes
5 replies
nathangross's avatar

This works, but seems a bit heavy handed:

<a href="{{ Nova::path() . '/resources/post/' . $post->id . '/edit' }}">Edit</a>

Curious if there is a better way.

siangboon's avatar

generally, if you have named the route accordingly, you can generating the URLs to the named routes with the parameters as the second argument to the route function..

route('post.edit', ['id' => $post->id])
nathangross's avatar

Thanks @siangboon

However, I'm using Laravel Nova for a backend so I have not defined those routes. I was hoping Nova offered something similar though.

dipherent's avatar

Hi @nathangross Have you found a better way to do this? Can you please share?

The above suggestion you put above works fine, but I was also wondering if there is a better way via routes or something...

Thanks

otrsw's avatar

You could use this button component https://github.com/dillingham/nova-button

It allows for easy linking - see extract from docs:

Button::make('Text')->index('App\Nova\User') Button::make('Text')->detail('App\Nova\User', $this->user_id) Button::make('Text')->create('App\Nova\User') Button::make('Text')->edit('App\Nova\User', $this->user_id) Button::make('Text')->lens('App\Nova\User', 'users-without-confirmation')

Please or to participate in this conversation.