Skip to content

Commit 53163c5

Browse files
authored
Vue 3 in Laravel with router, stores and locales
How To Install Vue 3 in Laravel 11 with Vite (vue-router, i18n locales, pinia stores).
1 parent 95c0168 commit 53163c5

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

vue/README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
# Vue 3 with router, stores and locales
1+
# Vue 3 in Laravel with router, stores and locales
22

3-
How To Install Vue 3 in Laravel 10 with Vite (router, locales, stores).
3+
How To Install Vue 3 in Laravel 11 with Vite (router, locales, stores).
44

55
## Create project
66

7-
Copy files from vue to laravel-project directory.
7+
Copy files from **vue** to laravel-project directory.
88

99
```sh
10-
composer create-project --prefer-dist laravel/laravel:^10.0 laravel-project
11-
cd laravel-project
12-
```
10+
composer create-project --prefer-dist laravel/laravel:^11 laravel-project
1311

14-
### Change in .env
15-
16-
```sh
17-
APP_URL=http://localhost:8000
12+
cd laravel-project
1813
```
1914

2015
### Add in routes/web.php
2116

2217
```php
2318
<?php
24-
// Last route
19+
// Laravel routes
20+
// ...
21+
22+
// Vue routes
23+
Route::get('/', function () {
24+
return view('welcome');
25+
});
26+
27+
// Vue Last route
2528
Route::fallback(function() {
2629
return view('welcome');
2730
});
@@ -45,4 +48,12 @@ npm install @googlemaps/js-api-loader
4548
```sh
4649
npm run build
4750
php artisan serve
51+
php artisan serve --host=localhost --port=8000
52+
```
53+
54+
### Change in .env
55+
56+
```sh
57+
# Dev server only
58+
APP_URL=http://localhost:8000
4859
```

0 commit comments

Comments
 (0)