Laravel Nova-将Nova指向资源页面的路径 [英] Laravel Nova - Point Nova path to resource page
问题描述
我需要将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屋!