Laravel backend integrated with Sanctum, using cookie-based SPA session authentication
laravel-sanctum-vue-spa — Vue Starter Template
By serkandyck
A Vue single-page application starter template built on Laravel 7 and Sanctum, including authentication pages for login, registration, email verification, and password reset.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Preview provided in the project README.
One original preview is available. Open the full image to inspect the design.
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Frontend is Vue, with VueRouter, Vuex, VueI18n, and ESLint
Pages use dynamic imports and custom layouts, with Tailwind CSS for styling
Built-in login, registration, email verification, and password reset pages
Provides npm run watch / npm run hot for development and npm run production for production builds
Template Details
This is a Laravel + Sanctum + Vue single-page application (SPA) starter template. The author states it was inspired by cretueusebiu/laravel-vue-spa. The frontend uses Vue along with VueRouter, Vuex, VueI18n, and ESLint; pages use dynamic imports and custom layouts, and the styling layer uses Tailwind CSS. The backend is Laravel, with authentication implemented through Sanctum using Laravel's built-in cookie-based session authentication rather than tokens, so it includes CSRF protection and session authentication, and it only attempts cookie authentication when requests come from its own SPA frontend. The template already provides login, registration, email verification, and password reset pages. Installation steps include cloning the repository, running composer install, configuring the database connection in .env as well as SESSION_DOMAIN and SANCTUM_STATEFUL_DOMAINS (default 127.0.0.1), running php artisan migrate, and running npm install. During development, npm run watch or npm run hot can be used, and production builds use npm run production. The repository is under the MIT license, allowing free use, modification, commercial use, and distribution of this version of the code, provided copyright and license notices are retained; third-party assets such as demo images, fonts, and icons, as well as external services such as domains, hosting, and databases, must have their licenses and fees checked separately.
Is it right for your project?
Use Cases
- Projects that need to set up a Laravel session authentication backend for a Vue single-page application
- Starter projects that want login, registration, email verification, and password reset pages out of the box
- Developers who want to reference how Sanctum's cookie-based SPA authentication is configured
Suitable For
- Full-stack developers using the Laravel and Vue technology stack
- Personal or small-team projects that need an SPA authentication starter template
- Developers who want to build on MIT-licensed code for secondary development
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
After cloning the repository, run composer install and npm install in sequence
- 2
Configure the database connection in .env, and set SESSION_DOMAIN and SANCTUM_STATEFUL_DOMAINS (default 127.0.0.1)
- 3
Run php artisan migrate to complete the database migration
- 4
During development, use npm run watch or npm run hot; for production builds, use npm run production
- 5
Third-party assets and external services (domains, hosting, databases, etc.) require separate license and cost checks
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis listing covers the free version under the MIT license in a public repository; the free scope is the code of this version and does not mean that external services or third-party assets are free.
Must comply with when using
- Free use, modification, commercial use, and distribution of this version of the code are permitted.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Before use, you must configure the database connection yourself and set the SESSION_DOMAIN and SANCTUM_STATEFUL_DOMAINS environment variables (default value 127.0.0.1); otherwise, Sanctum's cookie session authentication will not work properly.
- Sanctum only attempts cookie authentication when requests come from its own SPA frontend, so the frontend and backend must be on the same domain or the stateful domains must be configured correctly; cross-domain or third-party frontend calls will not be able to log in through this authentication method.
- Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
- External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
Edit `.env` and set your database connection details and set your environment SESSION_DOMAIN, SANCTUM_STATEFUL_DOMAINS default 127.0.0.1
Original README
https://github.com/serkandyck/laravel-sanctum-vue-spa/blob/master/LICENSEhttps://github.com/serkandyck/laravel-sanctum-vue-spa/blob/master/README.mdSanctum will only attempt to authenticate using cookies when the incoming request originates from your own SPA frontend.
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-02. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 77 / 100
- Technologies
- Vue · Laravel
- Website type
- Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2023-02-01
- Screenshot last checked
- 2026-10-02
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Vue as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Automatically checked against source and license rules; no manual editorial review.
Inspect the recorded source material
SHA-256: 9a686c5fc7b60d5b2d4cf460a1200585dca99f6d15e49217f1b9baf51313820f
2026-10-02T14:51:18.187Z
Source file / repository# Laravel7-Sanctum-Vue SPA > A Laravel-Sanctum-Vue SPA starter project template. This project inspired [cretueusebiu/laravel-vue-spa](https://github.com/cretueusebiu/laravel-vue-spa) <p align="center"> <img src="https://raw.githubusercontent.com/serkandyck/laravel-sanctum-vue-spa/master/screenshot/login.jpg"> </p> ## Features - Laravel 7.0 With Sanctum - Vue + VueRouter + Vuex + VueI18n + ESlint - Pages with dynamic import and custom layouts - Login, register, email verification and password reset all functional on airlock - Authentication with [Sanctum](https://github.com/laravel/sanctum) - [Tailwind CSS](https://tailwindcss.com/) ## Installation - `git clone https://github.com/serkandyck/laravel-sanctum-vue-spa` - `composer install` - Edit `.env` and set your database connection details and set your environment SESSION_DOMAIN, SANCTUM_STATEFUL_DOMAINS default 127.0.0.1 - `php artisan migrate` - `npm install` ## Usage #### Development ```bash # build and watch npm run watch # serve with hot reloading npm run hot ``` #### Production ```bash npm run production ``` ## Sanctum This project uses a Sanctum SPA Authentication. Sanctum does not use tokens of any kind. Instead, Sanctum uses Laravel's built-in cookie based session authentication services. This provides the benefits of CSRF protection, session authentication, as well as protects against leakage of the authentication credentials via XSS. Sanctum will only attempt to authenticate using cookies when the incoming request originates from your own SPA frontend. [More Details](https://laravel.com/docs/7.x/sanctum)
Explore similar templates
Compare previews and descriptions within the same stack and category.

vitesse
Vitesse is an opinionated Vite + Vue 3 starter template maintained by antfu-collective, offering file-based routing, component and API auto-import, Pinia, UnoCSS, PWA, i18n, Markdown, vite-ssg, TypeScript, Vitest, and Cypress.
Vue · Starter

vitesse-webext
vitesse-webext is a Vite-powered WebExtension starter template using Vue 3 and TypeScript, with built-in popup, options, and content script examples. It targets Chrome and Firefox, integrates webextension-polyfill, webext-bridge, UnoCSS, VueUse, and unplugin tools, and supports hot reload during development.
Vue · Starter

laravel-vue-spa
A Laravel + Vue SPA starter kit for quickly building a decoupled web application skeleton. It includes login, registration, email verification, and password reset flows, uses JWT for authentication, and integrates Laravel Socialite with GitHub as an example provider.
Vue · Starter

vue3-h5-template
A mobile H5 starter template built on Vue3, Vite, and Vant4, with TypeScript by default and JavaScript and i18n branches.
Vue · Starter

tov-template
tov-template is an MIT-licensed Vite + Vue 3 + TypeScript starter maintained by dishait. It bundles file-based routing, layouts, Mock, auto-imports, UnoCSS, Pinia, vue-request, Vitest, i18n, dark mode, Dockerfile, and engineering scripts.
Vue · Starter

shadcn-vue-landing-page
A Vue + Shadcn-Vue + TypeScript + Tailwind landing page template with sections like Navbar, Hero, Pricing, FAQ, Team, and Contact, plus dark mode and responsive layout.
Vue · Corporate Website
