This repository contains the complete source code for the tutorial:
👉 Laravel 12 Vue 3 Token-Based Authentication – Complete Guide
Read the full tutorial here:
https://laravelcenter.com/laravel-12-vue-3-token-based-authentication/
This project demonstrates how to build a modern token-based authentication system using Laravel 12 + Vue 3, including API login, registration, token storage, and protected routes.
- Laravel API authentication using token-based login
- Vue 3 Composition API authentication flow
- Store tokens securely in localStorage
- Protect Vue routes using navigation guards
- Axios interceptors for attaching authentication tokens
- Login, registration, logout, and user profile
- API rate limiting & token validation
- Simple Bootstrap UI for quick understanding
# Clone this repository
git clone https://github.com/YourUsername/laravel-vue-token-auth.git
cd laravel-vue-token-auth
# Install backend dependencies
composer install
# Install frontend dependencies
npm install
# Build frontend assets
npm run dev
# Configure environment
cp .env.example .env
php artisan key:generate
# Run database migrations
php artisan migrate
# Start the development server
php artisan serve
- Laravel 12
- Vue.js 3
- Axios
- Bootstrap 5
- PHP 8.3+
- MySQL 8+
Follow the full step-by-step tutorial here: https://laravelcenter.com/laravel-12-vue-3-token-based-authentication
laravel | vue | vue3 | axios | authentication | token-authentication | api-auth | bootstrap | spa | laravel-vue | web-development | tutorial
If this tutorial helps you, please star this repository and follow me on GitHub.
Your support motivates me to create more high-quality, free tutorials.
