Published 1/1/2024 · 2 min read
If you want to build a completely separate SPA that consumes a Laravel API, this series provides everything you need to get set up with modern tooling.
We’ll be using:
- Laravel 11 with Sanctum for API authentication
- Vue 3 with the Composition API
- Pinia for state management (the official replacement for Vuex)
- Vite for fast development builds
- TypeScript support (optional but recommended)
If you would like to hear an excellent explanation from Taylor on how Sanctum and Fortify came about, I highly recommend listening to his podcast episode.
The example project files can be found on GitHub:
What You’ll Build
By the end of this series, you’ll have:
- A Laravel API with full authentication (login, register, password reset, email verification)
- A Vue 3 SPA with protected routes and role-based access
- File upload functionality with cloud storage
- Reusable middleware patterns for route protection
- Pagination and error handling patterns
Prerequisites
- Basic knowledge of PHP and Laravel
- Familiarity with JavaScript and Vue.js
- Docker installed (we’ll use Laravel Sail)
- Node.js 18+ installed
Questions
If you have any questions please feel free to start a discussion over on GitHub.
Next up: Setting up the Laravel API with Sanctum and Fortify.
Related Articles
- Your First x402 Server: Pay-Per-Request API
Build an Express API that requires Solana USDC payments. Return 402, verify payments, serve content.
- What is x402? The HTTP Status Code That Changes Everything
HTTP 402 'Payment Required' finally has a real implementation. Learn how x402 enables pay-per-request APIs and micropayments on the web.
- Form Handling: Moving from Vue to Svelte
A practical guide to translating Vue form patterns to Svelte, covering two-way binding, validation, async submission, and what actually works better in each framework.