Skip to content

A complete example of implementing token-based authentication using Laravel 12, Vue 3, Axios, and Bootstrap 5. Includes login, registration, protected API routes, token storage, and user session handling.

Notifications You must be signed in to change notification settings

senghokeang/laravel-vue-token-auth

Repository files navigation

Laravel Vue.js Token-Based Authentication

Laravel Vue.js Token-Based Authentication

Laravel
PHP
Vue.js
Axios

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.


🚀 Features

  • 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

🛠 Installation

# 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

📦 Tech Stack

  • Laravel 12
  • Vue.js 3
  • Axios
  • Bootstrap 5
  • PHP 8.3+
  • MySQL 8+

🔗 Tutorial

Follow the full step-by-step tutorial here: https://laravelcenter.com/laravel-12-vue-3-token-based-authentication

📌 Topics / Tags

laravel | vue | vue3 | axios | authentication | token-authentication | api-auth | bootstrap | spa | laravel-vue | web-development | tutorial

⭐ Support

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.

About

A complete example of implementing token-based authentication using Laravel 12, Vue 3, Axios, and Bootstrap 5. Includes login, registration, protected API routes, token storage, and user session handling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published