Laravel 12/13 + Sanctum REST API + Spatie Query Builder
Hardened REST API starter combining Laravel 12/13, Laravel Sanctum token authentication with ability scoping, Spatie Query Builder for advanced filtering/sorting, strict BOLA/IDOR policy authorization, rate-limiting throttle middleware, and rootless container isolation.
docker compose up -d
# Laravel 12/13 + Sanctum REST API + Spatie Query Builder — Claude Code Guidelines (CLAUDE.md)
# Auto-generated from rules/source/*.md by tools/transpiler.py. Do NOT edit directly.
## Quick Reference & Non-Negotiable Standards
### 01 Architecture And Standards
> Laravel REST API Architecture, Standards, and Directory Structure
# Rule 01: REST API Architecture & Standards
- All API routes must reside under the `/api/v1/` prefix in `routes/api.php`.
- Every controller action must return a strictly typed `JsonResource` or `AnonymousResourceCollection`.
- Never return Eloquent models or raw database collections directly from controller actions.
- Model mutations must use dedicated Form Request classes (`StoreProjectRequest`, `UpdateProjectRequest`).
- API status codes must follow standard HTTP semantics:
- `200 OK` for successful GET, PUT, PATCH operations.
- `201 Created` for successful POST operations.
- `204 No Content` for successful DELETE operations.
- `400 Bad Request` for malformed query parameters.
- `401 Unauthorized` for missing or invalid Bearer tokens.
- `403 Forbidden` for policy authorization or ability scope failures.
- `404 Not Found` for nonexistent r
...
| Design Token | Specification | Standard Enforcement |
|---|---|---|
| color.brand | #e85d26 (Orange status accent) | Status lights, active tabs, focus rings, primary CTA |
| color.surface.dark | #0A0A0B (Base) • #131316 (Raised) • #26262C (Hairline) | Dark-first showcase theme, hairline borders, no shadows |
| font.family.ui | Instrument Sans (14px base, tight scale) | Small and dense dashboard typography, zero AI slop |
| focus.ring | 2px #e85d26 outline, 2px offset | Universal high-visibility focus ring, WCAG 2.2 AA compliant |
Clone and Inspect
Clone repository, navigate to kits/laravel-api-sanctum, and start container services via docker compose.
Anchor AI Agent
Feed the Agent Bootstrap Prompt into Claude Code, Cursor, Codex, or Copilot. Agent consumes native rules and skills.
Verify Security Gates
Run automated CI evaluation. Security scanners assert zero vulnerabilities before merging features to production.
7-Part Installation & Setup Standard
1. Prerequisites Table
| Tool | Minimum Version | Check Command | Where to Get |
|---|---|---|---|
| Docker Engine | 24.0+ | docker --version | docker.com |
| Docker Compose | v2.20+ | docker compose version | Bundled with Docker |
| Git | 2.40+ | git --version | git-scm.com |
2. Quickstart Execution
git clone https://github.com/Umar-444/Techtalks-stack-kits.git cd Techtalks-stack-kits/kits/laravel-api-sanctum/starter cp .env.example .env docker compose up --build -d
3. Multi-Agent Rule Placement
4. Post-Install Verification Probes
Kit FAQ & Operational Details
↓
↓
↓
↓
↓
↓
↓
↓
↓
↓
↓
↓
↓
↓
Paste this exact prompt into Claude Code, Cursor, Copilot, or Antigravity to anchor the agent in the kit's rules and invariants:
You are building with the Laravel 12/13 + Sanctum REST API + Spatie Query Builder kit. Adhere strictly to rules in CLAUDE.md / .cursor/rules, design tokens in DESIGN.md, and steps/agent-build-steps.md.