import VueRouter from 'vue-router'
const routes = [
{
path: '/',
name: 'demo',
component: () => import ('./pages/Demo'),
meta: {
auth: false
}
},
{
path: '/register',
name: 'register',
component: () => import ('./pages/Register'),
meta: {
auth: false
}
},
{
path: '/login',
name: 'login',
component: () => import ('./pages/Login'),
meta: {
auth: false
}
},
{
path: '/dashboard',
name: 'dashboard',
component: () => import ('./pages/user/Dashboard'),
meta: {
auth: true
}
},
{
path: '/test',
name: 'testview',
component: () => import ('./pages/user/TestView'),
meta: {
auth: true
}
},
{
path: '/settings',
name: 'settings',
component: () => import ('./pages/user/Settings'),
meta: {
auth: true
}
},
{
path: '/404',
name: 'redirect',
redirect: '/dashboard',
meta: {
auth: true
}
},
]
const router = new VueRouter({
history: true,
mode: 'history',
routes,
})
export default router
require('bootstrap');
import 'es6-promise/auto'
import axios from 'axios'
import Vue from 'vue'
import VueAuth from '@websanova/vue-auth'
import VueAxios from 'vue-axios'
import VueRouter from 'vue-router'
import Index from './Index'
import auth from './auth'
import router from './router'
import {Lang} from 'laravel-vue-lang'
import titleMixin from './titleMixin'
Vue.use(Lang, {
locale: 'uz',
fallback: 'uz',
ignore: {
uz: ['validation'],
},
});
Vue.mixin({
methods: {
assets(path) {
var base_path = window._assets || '';
return base_path + path;
}
}
})
Vue.mixin(titleMixin)
window.Vue = Vue
Vue.router = router
Vue.use(VueRouter)
Vue.use(VueAxios, axios)
axios.defaults.baseURL = `${process.env.MIX_APP_URL}/api/v1`
Vue.use(VueAuth, auth)
Vue.component('index', Index)
const app = new Vue({
el: '#app',
router
})