Reputation: 1275
I need to point Nova path to a resouce. So that when a user login, he`ll directed to that particular resource.
I have updated this path in /config/nova.php
:
'path' => '/crm/resources/clients'
Now after login, I can see the URL updated. But the page is still Welcome Nova page.
Any idea on this?
Upvotes: 4
Views: 6122
Reputation: 1622
You can create a custom Asset or Tool to hook into the Vue Router. In our specific case, we wanted to redirect to our custom tool instead of a resource or the dashboard. Creating a tool generates a tool.js
file where it allows you to hook into the vue-router.
router.beforeEach((to, from, next) => {
if (to.name == "dashboard.custom") {
next({
name: "reports" // Route added by our tool
});
} else {
next();
}
});
router.beforeEach((to, from, next) => {
if (to.name == "dashboard.custom") {
next({
name: "index",
params: {
resourceName: 'model' // replace with resource name
}
});
} else {
next();
}
});
Note resourceName
is the name of the dynamic segment defined in the index route.
Upvotes: 2