inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.03k stars 227 forks source link

Path to the VUE component outside the module #545

Closed atach closed 12 months ago

atach commented 1 year ago

Hello, I may have a strange question, but I have it.

I'm using a modular structure (laravel-modules) and VITE is in one of the main modules. Now I'm faced with a problem: if I try to render a page in another module, "Inertia" always goes along the path of the main module.

Example: Example: Here is VITE and the main module with vue components:

/Modules/GeneralModule/vite.config.js
/Modules/GeneralModule/Resources/js/app.js
/Modules/GeneralModule/Resources/js/Pages/MyModule1.vue

But some components are located in other modules. I don't understand how to access them. /Modules/SecondModule/Resources/js/Pages/MyModule2.vue

Which path in the controller should be specified in order to access components from another module? return Inertia::render('MyModule2.vue', $template->complete());

Part of the app.js code which is located in /Modules/GeneralModule/Resources/js/app.js

createInertiaApp({
    resolve: (name) => resolvePageComponent(
        `./Pages/${name}.vue`, import.meta.glob('./**/*.vue')
    )
});
jessarcher commented 12 months ago

Hi there,

Thanks for reporting the problem you are encountering, but it looks like this is a question that may be better suited for a support channel. We only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use the functionality provided by this repository, you can try one of the following channels:

However, this issue will not be locked, and everyone is free to discuss solutions to your problem!