4

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?

1 Answer 1

2

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.


Redirect from the dashboard to a named route

router.beforeEach((to, from, next) => {
   if (to.name == "dashboard.custom") {
      next({
          name: "reports" // Route added by our tool
      });
   } else {
      next();
   }
});

Redirect from the dashboard to a resource index

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.

Showing why resourceName is used as the property name in the code above

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.