Skip to content

A complete example of implementing session-based authentication using Laravel 12, Vue 3, Axios, and Bootstrap. Includes login, registration, CSRF protection, middleware, and SPA-style session handling.

Notifications You must be signed in to change notification settings

senghokeang/laravel-vue-session-auth

Repository files navigation

Laravel Vue.js Session Based Authentication

Laravel Vue.js Session Based Authentication

Laravel
PHP
Vue.js
Axios

This repository contains the complete source code for the tutorial:
👉 Laravel 12 Vue 3 Session Based Authentication – Full Guide
Read the full tutorial here:
https://laravelcenter.com/laravel-12-vue-3-session-based-authentication/

This project demonstrates how to build a session-based authentication system using Laravel 12 + Vue 3, with CSRF protection, Axios, and a simple SPA structure.


🚀 Features

  • Laravel session-based login & registration
  • Built-in CSRF token protection
  • Vue 3 Composition API
  • Axios with credentials-based requests
  • Protected routes using navigation guards
  • User login, logout, and profile retrieval
  • Bootstrap UI for fast development
  • Clean and extendable folder structure

🛠 Installation

# Clone this repository
git clone https://github.com/YourUsername/laravel-vue-session-auth.git
cd laravel-vue-session-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

# Setup database connection in .env
# Then run 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-session-based-authentication

📌 Topics / Tags

laravel | vue | vue3 | axios | authentication | session-authentication | csrf | 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 session-based authentication using Laravel 12, Vue 3, Axios, and Bootstrap. Includes login, registration, CSRF protection, middleware, and SPA-style session handling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published