Skip to content

xignp/laravel-vue3-ts-vuetify3-starter-kit

Repository files navigation

Starter-Kit(BaseTemplate) for Laravel+Vue3+TS+Vuetify3+VueRouter4+Pinia

Demo

ss1 ss2

Features

  • Laravel9
  • Vue3
  • Typescript
  • Vuetify3 beta
  • VueRouter4
  • Pinia
  • SASS
  • Material Design Icons
  • Axios
  • Custom Theme (Vuetify)
  • 404ErrorPage (VueRouter)
  • Example Header and Footer Component

Get Started

  1. Install packages.
composer install
npm install
  1. Create .env file
cp .env.example .env
  1. Generate hash key
php artisan key:generate
  1. Clear cash
php artisan config:cache
  1. Run dev server
php artisan serve
npm run dev

Axios Plugin

You can use existing axios instance if you need to fetch api.

resources/js/plugins/api.ts

import axios from 'axios'

const api = axios.create({
  baseURL: process.env.MIX_API_BASE_URL,
  // withCredentials: true,
})

export default api

Fetch Sample

import api from '../plugins/api'
const getUser = async () => {
  try {
    const response = await api.get('/user')
    console.log(response.data)
  } catch (e) {
    console.log(e)
  }
}

License

This is open-sourced software licensed under the MIT license.