How to Install VueJs in Laravel

In this tutorial we will learn how to install vue js in laravel, Vue.js is an open source javaScript framework for building UI(user interfaces) and single-page applications for website. Here, we will install vuejs in laravel 8 with laravel 8 vue npm install

So let's start and see how to install vue in laravel 8.

 

Step 1 : Install Laravel

In first stps we need to install new laravel project in our system for install vuejs in laravel 8, run below command to install laravel

composer create-project --prefer-dist laravel/laravel blog

 

 Step 2 : Install Laravel/ui

Now, we required to install laravel ui in this project so run below command in your terminal.

composer require laravel/ui

 

Step 3 : Install Vue

After installation of above package we are installing vue with our application.

We can install Vuejs two diffrent way, first one is a simple vue setup install and second is install vue with auth. So let's check both way.

 1) Simple setup

php artisan ui vue

2) Install vue with auth for default laravel login and register

php artisan ui vue --auth

Now,We have installed vue, you can see in your resource directory js folder as per bellow screen print.

vue

 

 

component

 

Step 4 : Install Node

Here, we also required npm for run vuejs. so,we need to install NPM to get proper output of vuejs.first of all download npm from below link.

https://www.npmjs.com/get-npm

After installation of NPM we need to check whether it is install or not, So, run below code and run in your terminal to check.

node -v

 

Step 5 : Install NPM

 As of now we need to install npm in our project so run below code in your terminal.

npm install

 

Step 6 : Run NPM

Now, run npm in your system with below code.

npm run dev

 that's it now you are able to run vue js in your laravel application.

Here, we have added 2 images of form output before install npm view and after install npm view

 

Before Install NPM

before_install_npm

 

After Install NPM

after_install_npm

 


 

You might also like :

FEATURE POSTS