@bobbybouwmann I could not get your solution to work. Trying to do so causes an InvalidArgumentException: Action Laravel\Nova\Http\Controllers\RouterController@show not defined. thrown on line 459 in vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php which is simply because the nova.index route is not defined (dd'ed $this->routes).
This seems to correspond to the response in this issue, and I can confirm that it does not work in Laravel Nova v3.8.2: https://github.com/laravel/nova-issues/issues/2724
Workaround solution
Implementing an invokable controller like so:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class NovaResourceRedirectController extends Controller
{
/**
* Redirect to a Laravel Nova Resource.
*
* @param Request $request
* @param string $resource
* @param int|null $id
* @return \Illuminate\Http\RedirectResponse
*/
public function __invoke(Request $request, string $resource, ?int $id = null)
{
// Nova does not have a named route (uses Vue router) so instead redirect to the router
// @see https://laracasts.com/discuss/channels/nova/nova-resource-route-redirect?page=1
// @see https://github.com/laravel/nova-issues/issues/2724
return redirect()->to(config('nova.path')."/resources/{$resource}/{$id}");
}
}
and setting up a route for this in routes/web.php
Route::get('/nova-redirect/resources/{resource}/{id?}', 'NovaResourceRedirectController')->name('nova.resource');
Make is possible to link to a Nova resource using:
```php
return redirect()->route('nova.resource', ['resource' => 'users', 'id' => 1]);