Skip to content

Instantly share code, notes, and snippets.

@ratiw
Last active November 6, 2020 14:23
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ratiw/a04b7eb9a2c80b9c950b to your computer and use it in GitHub Desktop.
Save ratiw/a04b7eb9a2c80b9c950b to your computer and use it in GitHub Desktop.

Steps

  1. Setup Laravel app
  2. Setup vue.js inside laravel app

Setup Laravel app

  • New Laravel app
  • Rename .env.example to .env
  • Config config/database.php to MySQL or SQLite
  • For SQLite, run touch storage/database.sqlite to create sqlite database
  • (optional) Create necessary Models and migrations using art make:model -m
  • (optional) Setup migrations as appropriate
    • (optional) Migrate the database
    • (optional) Setup fake data using factory
  • (optional) Create master page (main template)
    • pull in bootstrap via CDN or whatever
    • pull in browserify <script src="/js/bundle.js">

Setup vue.js inside Laravel app

  • Define vue.js scope with <div id="app"></div>
  • Setup vue.js app entry point by creating app.js
  • Install Elixer with npm install
  • Install vue.js using npm install vue --save
  • Open app.js and type the following
var Vue = require('vue');
 
new Vue({
 el: '#app'
});
@Forison
Copy link

Forison commented Mar 17, 2019

hi can you help me set up vue in laravel ?mine appears like a plain text or like a file whose extension is no known.

@nipunTharuksha
Copy link

@Forison whats is the wrong with you code.Submit your code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment