Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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

This comment has been minimized.

Copy link

@Forison 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

This comment has been minimized.

Copy link

@nipunTharuksha nipunTharuksha commented Apr 2, 2019

@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