3 Easy Steps to Install & Configure Vue JS in Laravel 8

12
nusagates notes
nusagates notes

Tersedia versi bahasa : Indonesian

Here’s how to use VueJs in Laravel 8

Install Composer package laravel/ui

We need to install laravel/ui package to use VueJs on laravel. The method is as follows:

composer require laravel/ui

Configuring scaffolding vue using laravel ui

Laravel Ui provides tools to configure everything needed to use VueJS in Laravel. The method is quite easy, just run the following command:

php artisan ui vue

Compile File

After the vue scaffolding is configured by Laravel Ui, the next step is to install and compile all the dependencies. You can do this simply by running the following command:

npm install && npm run dev

Add this to the blade template to use VueJS on the blade template

<link rel="stylesheet" href="{{ mix('css/app.css') }}"/>
<script defer src="{{ mix('js/app.js') }}"></script>
Sampaikan pendapatmu di sini.

Tanggapan Kamu?