Making and Setting up Vue Router and components

Опубликовано: 16 Март 2025
на канале: Code Combination
59
1

Hello,
In this video we will learn how to make SPA in Vue js with laravel.
--------
Steps by process:
--------
1)First we will install new laravel project and after that we will install laravel ui
2) we will install vue router
3) we make routes.js file and import in app.js along with VueRouter
4) we make components and include them in routes.js file
5) after that we call router-view tag in welcome.blade where all components will be rendered
-------
Steps by commands
-------
1) laravel new 'ProjectName'
2) composer require laravel/ui
3)php artisan ui vue --auth
4) npm install
5) npm run dev(repeat until you get "Laravel build successful toast on right or left side")
6) npm install vue-router
7) npm run dev same as step 5
8)lastly you can do npm run watch so that you dont have to do npm run dev again
9)Open other terminal and serve your project there so that npm run watch in forst terminal doesnt get disturbed