Laravel Nova-将Nova指向资源页面的路径 [英] Laravel Nova - Point Nova path to resource page

查看:262
本文介绍了Laravel Nova-将Nova指向资源页面的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将Nova路径指向一个资源.这样,当用户登录时,他将定向到该特定资源.

I need to point Nova path to a resouce. So that when a user login, he`ll directed to that particular resource.

我已经在/config/nova.php中更新了此路径:

I have updated this path in /config/nova.php:

'path' => '/crm/resources/clients' 

现在登录后,我可以看到URL更新了.但是该页面仍然是Welcome Nova页面.

Now after login, I can see the URL updated. But the page is still Welcome Nova page.

对此有任何想法吗?

推荐答案

config/nova.php中的path设置是可从其中访问Nova的URI路径.例如,如果您设置path' => '/crm,则客户端资源索引URL将是/crm/resources/clients而不是/nova/resources/clients.它不控制登录重定向路径.

The path settings in config/nova.php is the URI path where Nova will be accessible from. For example if you set path' => '/crm, then client resource index URL will be /crm/resources/clients instead of /nova/resources/clients. It doesn't control the login redirect path.

您可以在nova/src/Http/Controllers/LoginController.php中编辑redirectPath()功能.

public function redirectPath()
{
    return Nova::path() . '/resources/clients';
}

重要 :我不确定在nova文件夹下编辑文件是否是一个好习惯.将来在更新版本时,更改可能会被覆盖.所以请注意.

Important : I'm not sure whether editing file under nova folder is a good practice. In future when update the version the changes may override. So please be aware of it.

这篇关于Laravel Nova-将Nova指向资源页面的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆