Introduction
Laravel Breeze API + Next.js is a modern, production-ready fullstack template that combines a robust Laravel 12 backend with an elegant Next.js 16 frontend. Built on top of Laravel Breeze Next TypeScript, this template provides additional backend functionality and a complete authentication system powered by Laravel Sanctum.What is Laravel Breeze API + Next.js?
This template provides a complete fullstack solution for building Single Page Applications (SPAs) with:- Backend: Modern RESTful API built with Laravel 12, featuring Sanctum authentication and a scalable structure
- Frontend: Modern React application with TypeScript, Tailwind CSS, and accessibility-focused components
Who is this for?
This template is ideal for developers who want to:- Build modern SPAs with a robust backend and elegant frontend
- Leverage Laravel’s powerful ecosystem with React’s flexibility
- Start with production-ready authentication out of the box
- Develop with type safety using TypeScript
- Scale applications with a proven architecture
Key Features
Backend (Laravel 12)
- Laravel 12 - Modern, mature PHP framework
- Laravel Sanctum - Secure API authentication with tokens
- CORS Configured - Secure communication between frontend and backend
- Breeze Starter Kit - Pre-configured authentication structure
- Pest Testing - Modern PHP testing framework
- Database Ready - Migrations and seeders included
- Queue Support - Asynchronous task processing
- PHP 8.2+ - Latest language features
Frontend (Next.js 16)
- Next.js 16 - React framework with SSR and optimizations
- TypeScript - Static typing for better development experience
- Tailwind CSS - Modern utility-first CSS framework
- React 19 - Latest React features
- Formik + Yup - Form handling and validation
- Axios - HTTP client for API consumption
- SWR - Data fetching with caching and revalidation
- ESLint - Static code analysis
- Headless UI - Accessible, unstyled components
Project Structure
The project is organized into two main directories:Authentication
The project uses Laravel Sanctum for API authentication:- Users register/login through the frontend
- Backend validates credentials and generates a token
- Token is stored in the frontend (localStorage/cookies)
- All requests include the token in the
Authorization: Bearer <token>header