Skip to content

Commit 6a82c97

Browse files
authored
Install Vue 3 in Laravel 11 with Vite
How To Install Vue 3 in Laravel with Vite (router, i18n translation, pinia store).
1 parent 063f87f commit 6a82c97

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
# Vue 3 in Laravel 11
22

3-
How To Install Vue 3 in Laravel with Vite (router, i18n ranslation, pinia store).
3+
How To Install Vue 3 in Laravel with Vite (router, i18n translation, pinia store).
44

5-
## Create project
5+
## Full SPA example
6+
7+
Full example with router, i18n translation and pinia store in **vue** directory <https://github.com/atomjoy/laravel-vue3-vite-config/tree/main/vue>.
8+
9+
## Minimal SPA example (landing page)
10+
11+
Create Laravel project with composer.
612

713
```sh
8-
composer create-project --prefer-dist laravel/laravel:^11.0 laravel-vue
14+
composer create-project laravel/laravel laravel-vue --prefer-dist
15+
916
cd laravel-vue
1017
```
1118

12-
## Install
19+
### Vue, Vite plugins
1320

14-
Minimal SPA application. Full example with router, i18n translation and pinia store in **vue** directory.
21+
Minimal SPA application.
1522

1623
```sh
1724
npm install
1825
npm install vue@latest
1926
npm install --save-dev @vitejs/plugin-vue
27+
npm install axios
2028
```
2129

2230
## Config
@@ -119,24 +127,14 @@ Route::fallback(function() {
119127
});
120128
```
121129

122-
## Build and run
130+
### Build and run
123131

124132
```sh
125133
npm run build
126134
php artisan serve
127135
```
128136

129-
## Install optional packages
130-
131-
```sh
132-
npm install axios
133-
npm install pinia
134-
npm install vue-i18n@9
135-
npm install vue-router@4
136-
npm install @googlemaps/js-api-loader
137-
```
138-
139-
## Override /build dir in page url
137+
## Override /build dir in page url (errors)
140138

141139
```js
142140
// Add this in vue router/index.js

0 commit comments

Comments
 (0)