前言

環境

安裝 MySQL 8.0.12

brew install mysql
> brew unlink mariadb
> brew services stop mariadb
> …


// Laravel 提供的 helpers 文件路徑vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
require __DIR__.'/../vendor/autoload.php';
require __DIR__.'/../app/helpers.php';
"autoload": {
"files": [
"app/helpers.php",
...... // 加入其他要自動加載的檔案
],
......
}


環境

初始專案

composer create-project laravel/laravel laravel-vuespa // 創建一個 Laravel 的專案
cd laravel-vuespa
npm install . // 安裝 npm 依賴套件.
npm install vue-router --save // 安裝 vue-router 套件

修改 /resources/assets/js/app.js

require('./bootstrap');window.Vue = require('vue');// 引入 vue-router 套件
import VueRouter from 'vue-router';
import router from './routes';
// 引入 App 模板
import App from './pages/App'

Ethan Huang

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store