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.
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.
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])
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.
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
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 sign in or create an account to participate in this conversation.