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

Melodia's avatar

How to deploy a vuejs website

I have an existing domain with a WordPress website and now I added my Laravel-VueJs project. The domain is sidneylab.com, and I want the laravel site to be shown under this link: sidneylab.com/blog

I have done most of it and when I visit sidneylab.com/blog/ I can see the login/register section. However, my vue components are being ignored for some reason.

The project folder is inside the publi directory. And I moved the files from the public folder to the public_html folder I created. Inside that folder I have the index.php which has this in order for the link to work:

require DIR.'/../../blog/vendor/autoload.php';

$app = require_once DIR.'/../../blog/bootstrap/app.php';

Is there anything wrong am doing?

I have composer installed globally so it is just the vue components that do not show. From the project root directory I try to run npm commands and it does not work.

Hope someone can help.

This is what I have in my routes.js

import VueRouter from 'vue-router';
import Admin from './components/Admin.vue';
import Homepage from './components/Homepage.vue';
import AdminUsers from './components/AdminUsers.vue';
import AdminPosts from './components/AdminPosts.vue';
import Subscriber from './components/subscriber/Main.vue';
import Single from './components/Single.vue';
import Categories from './components/Categories.vue';

let routes = [
    {
        path: '/',
        component: Homepage
    },
    {
        path: '/subscriber',
        component: Subscriber
    },
    {
        path: '/post/:slug',
        name: 'post',    
        component: Single
    },
    {
        path: '/categories/:slug',
        component: Categories
    }
];

export default new VueRouter({
    mode: 'history',
    routes
});
0 likes
0 replies

Please or to participate in this conversation.