- php ( >= 7.2)
- composer
- nodejs (v14)
- npm
composer install
npm install
npm run dev
npm run watch (webpack will run after changing file)
npm run pro
npm run production (Require install mix library)
laravel new my-app
composer require laravel/ui
php artisan ui vue
npm install
npm install vue-loader@^15.9.7 --save-dev --legacy-peer-deps
npm install laravel-mix@lastest
npm install postcss@^8.3.1 --save-dev --legacy-peer-deps
npm i vue-loader
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Laravel Vue</title>
<!-- Scripts -->
<script src="{{ mix('/js/app.js') }}" defer async></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
<div id="app">
<main class="py-3">
<router-view></router-view>
</main>
</div>
</body>
</html>
Route::get('/{any?}', [
function () {
return view('welcome');
}
])->where('any', '.*');
php artisan serve
npm run dev