Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davestar057's avatar

Intertia v1.0 and Laravel 10 - using page.vue files outside of /resources/Pages folder?? issue

Hi, I have recently upgraded to the latest version of Inertia and laravel.

I also use modules, so have page templates outside of the default /resources/Pages folder. In the previous version of Inertia I could use the following in my app.js file to easily solve this.

const app = createInertiaApp({
    title: (title) => `${title} - ${appName}`,
    resolve: (name => {
        let parts = name.split('/') 
        let type = false
        if (parts.length > 1) {
            type = parts[0]
        }
        if (type) {
            let nameVue = parts[1].split('.')[0]
            return import("../../Modules/" + parts[0] + "/Resources/js/Pages/" + nameVue + ".vue")
        }else {
            return import(`./Pages/${name}`)
        }
    }),

However, this doesnt work with the new release of inertia? Is there a way around this? Seems very limited to be forced to house ALL your views in one folder?

I've also tried manually adding locations in the new setup using

    resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob(['./Pages/**/*.vue', '../../Modules/Settings/Resources/js/Pages/**/*.vue'])
    ),

but so far can find nothing that works!? any help would be massively appreciated, thanks

0 likes
1 reply

Please or to participate in this conversation.