Laravel 12 Frontend Setup with Vue 3 and Bootstrap 5.3
This guide walks you through installing and configuring Laravel 12 with Vue 3 and Bootstrap 5.3 using Vite, in a modular and scalable way — perfect for multi-page apps and future API integration.
Prerequisites
Ensure you have the following:
Tool | Recommended Version |
---|---|
PHP | 8.2 or newer |
Composer | 2.6+ |
Node.js | 18+ |
npm | 9+ |
Laravel CLI | composer global require laravel/installer |
Step 1: Create a Laravel 12 Project
Step 2: Clean Default Installation
Delete default resources/css
and resources/js/bootstrap.js
:
Step 3: Install Vue 3 and Bootstrap
Step 4: Configure Vite
vite.config.js
Step 5: Set up Dynamic Vue App Structure
Folder Structure
resources/js/app.js
resources/js/App.vue
resources/js/router/index.js
resources/js/pages/Home.vue
Step 6: Blade View Setup
resources/views/app.blade.php
Update Route
In routes/web.php
:
Step 7: Build and Run
Visit http://localhost:8000
You now have:
-
Laravel 12 backend
-
Vue 3 frontend
-
Vue Router enabled
-
Bootstrap 5.3 styling
Optional: Enable Vue Devtools
Add this to vite.config.js
For better debugging:
Summary
Feature | Enabled |
---|---|
Vue 3 | ✅ |
Vue Router | ✅ |
Bootstrap 5.3 | ✅ |
Laravel 12 API | Ready to add |
Vite Build Tool | ✅ |
Dynamic Routing | ✅ |
Next Steps
-
Add Axios for API integration
-
Implement CRUD with Laravel API
-
Set up Laravel Sanctum authentication
Let me know if you want a version that includes full CRUD functionality!