How to include Bootstrap-Vue in Laravel

Just execute npm i vue bootstrap-vue bootstrap inside folder there you have package.json or manually change package.json. Then you have to add into ./resources/assets/js/bootstrap.js

import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'

Vue.use(BootstrapVue)

Install your package with

npm install bootstrap-vue

or

yarn add bootstrap-vue

Then you can include globally your library by adding this row in your resources\js\app.js after window.Vue = require('vue');

Vue.use(require('bootstrap-vue'));

You can take a look to the official Vue documentation for plugins installation


You can do this simply by node and npm. install node in your system. and then open terminal from your project root directory like you do with laravel for running artisan commands.

when you open terminal. simply run

npm i bootstrap-vue // you can also give save falg to save in package.json file

Here am not installing vue .beacuse it's already installed in laravel if you check your app.js file, inside your resources directory and after successfully installing this you can import this in your app.js by

import BootstrapVue from 'bootstrap-vue' //Importing

Vue.use(BootstrapVue) // Telling Vue to use this in whole application

For css you can import this by simply

@import 'node_modules/bootstrap/scss/bootstrap';
@import 'node_modules/bootstrap-vue/src/index.scss';

in app.scss

After all configuration setup run

npm run dev //herewebpack do its work

or if you are in production, you can do this by

npm run production