This is a sample stand-alone php project with laravel-mix using PHP & VueJS 2 and Laravel Mix build with YARN or NPM
- Required: You need to have a basic understanding of laravel-mix, VueJS 2 and vue router.
- Optinal: Understanding sass, because you can use a simple css.
- First: Clone the repository
- Install all needed node package
- Run the below command and enjoy!
#yarn
yarn install
#or npm
npm install
- DotEnv: we use .env for app configuration, follow this step :
- create a new copy of .env.example and rename it to .env
- change the MIX_APP_PATH to your app path(make sur to include all subdirectory path, if the app is in subdirectory)
- Vue-router:
- Server configuration refer to this : https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations
Important: Please, if you are new with laravel-mix, see laravel mix docs more info.
Command to run mix build:
#yarn
yarn mix
#or npx
npx mix
Important: See all the available script at package.json
Run watch-poll (to detect automatically all changes):
#yarn
yarn watch-poll
#or npm
npm run watch-poll
The Progressive JavaScript Framework
Docs: https://v2.vuejs.org/v2/guide/
An elegant wrapper around Webpack for the 80% use case.
Docs : https://laravel-mix.com/docs
Yarn is a package manager that doubles down as project manager. Whether you work on one-shot projects or large monorepos, as a hobbyist or an enterprise user, we've got you covered.
Get Started : https://yarnpkg.com/getting-started
npm is the world's largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well.
Get Started : https://docs.npmjs.com/getting-started
Be cause it's a php project, so you can use composer to manage a php dependency.