纯 JSON API,无前端、Blade 或 Vite,响应结构统一,管理端接口位于 /admin
starter-laravel-api — Laravel 启动器模板
作者 websanova
基于 Laravel 的纯 JSON API 启动器,内置 Sanctum 令牌认证、账户管理、Stripe 订阅、角色权限、通知与统计。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
Sanctum 令牌认证,含注册、登录、登出、刷新与密码重置,令牌过期可配置
Stripe 订阅通过 Cashier 接入,支持订阅、切换、取消、恢复与促销码
Spatie 角色权限、数据库通知与邮件、每日数据库备份
Docker 开发环境含 MySQL、Redis、Mailpit 与 Stripe CLI,附 Pest 测试套件
模板详细介绍
这是一个只提供 JSON 接口的 Laravel API 启动器,不包含前端、Blade 模板或 Vite 构建。仓库定位为后端骨架,把认证、账户、计费与权限等常见 API 能力预先搭好,供后续在其上开发具体业务。
认证与账户:使用 Sanctum 令牌认证,覆盖注册、登录、登出、刷新令牌和密码重置,令牌过期时间可配置。账户验证基于验证码,支持多渠道,邮件通道已接通,短信通道为脚手架状态,每个通道可设为禁用、自动或必需。账户自助管理包含资料、密码、头像、邮箱变更、语言与时区设置,以及带宽限期的自助删除。
计费与订阅:通过 Cashier 接入 Stripe,支持订阅、切换套餐、取消与恢复,多种计费周期,结账流程由客户端构建;套餐支持免费增值、试用或必选模式,价格从服务商同步,可选自动计税。促销码会向服务商校验,可在结账时输入,管理员也能对已有订阅应用或清除。Webhook 做幂等处理,用于备份客户端同步并捕获外部变更,本地开发无需隧道。
权限、数据与运维:使用 Spatie 提供超级管理员与管理员角色,配合粗粒度权限和按目标对象的检查。示例 CRUD 以书签和标签展示关联、归属范围、过滤、排序与分页。统计按资源分组并支持日期范围拆分,另有按套餐的订阅统计。通知同时写入数据库并发送邮件,覆盖账户与套餐生命周期事件。备份使用 Spatie 每日备份数据库并定时清理。文件存储走 S3,兼容 AWS 或 DigitalOcean Spaces,头像在上传时裁剪缩放。本地化支持多语言响应与按用户本地化的邮件,新增语言只需放入语言目录。
开发环境:提供 Docker 配置,包含 MySQL、Redis、Mailpit 和 Stripe CLI,另有辅助脚本与 Pest 测试套件。邮件可对接任意 SMTP 服务商,本地用 Mailpit 捕获。
限制与注意:仓库本身不含前端界面,需要自行搭配客户端。README 说明相关命令仍属实验性质,格式仍在调整。演示站点截图来自作者个人网站,并非该 API 仓库自身的界面。
适合你的项目吗?
适用场景
- 为移动端或 Vue SPA 等客户端提供后端 API
- 需要账号体系、令牌认证与账户自助管理的项目
- 需要 Stripe 订阅计费、套餐限制与促销码的 SaaS 后端
- 需要角色权限、站内通知与订阅统计的管理型 API
适合人群
- 熟悉 Laravel 的后端开发者
- 需要现成认证与计费骨架的 API 项目
- 计划自行开发前端、只复用后端逻辑的团队
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
仓库不含前端,需另行准备客户端或搭配同系列前端项目
- 2
README 提到相关命令为实验性质,格式仍在调整
- 3
本地开发依赖 Docker 环境中的 MySQL、Redis、Mailpit 与 Stripe CLI
- 4
Stripe 相关功能需要自行配置服务商密钥与 Webhook
- 5
代码为 MIT 许可,但演示图片、字体、图标等第三方素材需单独核对许可
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- README 明确说明相关命令仍属实验性质,格式仍在调整,不保证稳定,不应视为生产就绪的固定接口。
- 计费功能依赖 Stripe 与 Laravel Cashier,需要自行注册 Stripe 账户、配置 API 密钥与 Webhook,属于外部服务要求。
- 文件存储依赖 AWS S3 或 DigitalOcean Spaces 等外部对象存储服务,需要自行开通并配置凭据。
- 邮件发送需要自行提供 SMTP 服务商账号与配置,本地开发依赖 Mailpit 捕获邮件。
- 账户验证的短信通道仅为脚手架状态,未实际接通,需要自行接入短信服务商才能使用。
- 本地开发环境依赖 Docker,并需要 MySQL、Redis、Mailpit 与 Stripe CLI 等组件。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
The commands are experimental and the format is still being tinkered with.
README 原文
Stripe via Cashier out of the box, swappable without touching the rest of the app.
README 原文
Off-server storage for AWS or DigitalOcean Spaces, with avatars cropped and resized on upload.
README 原文
Any SMTP provider, with a local mail catcher and test command for dev.
README 原文
Code-based, multi-channel verification (email wired, SMS scaffolded)
README 原文
https://github.com/websanova/starter-laravel-api/blob/main/LICENSEhttps://github.com/websanova/starter-laravel-api/blob/main/README.mdDockerized with MySQL, Redis, Mailpit, and Stripe CLI, plus a helper script and Pest test suite.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 80 / 100
- 技术栈
- Laravel
- 网站类型
- 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-30
- 截图检查日期
- 2026-10-01
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Laravel。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 6bae69c21f9b565f69cb0f1b49c28f524ea8cc6d5a9ca7c1499704bdbc18eaeb
2026-10-01T02:14:36.712Z
来源文件 / 仓库# Starter Laravel API A Laravel API starter with a full auth system, account management, and production-ready integrations out of the box. No frontend, no Blade, no Vite. Just a clean JSON API. Part of the Starters, built at [Websanova](https://www.websanova.com). ## Docs Full documentation at [websanova.com/docs/starter-api](https://www.websanova.com/docs/starter-api). - [Startup Guide](docs/startup-guide.md) - [Docker Guide](docs/docker-guide.md) - [Stripe Guide](docs/stripe-guide.md) - [Testing Guide](docs/testing-guide.md) - [Flows Guide](docs/flows-guide.md) ## Projects | Project | Repo | Demo | | ------- | ---- | ---- | | Starter Flows | [starter-flows](https://github.com/websanova/starter-flows) | [flows](https://starter-flows.websanova.com) | | Starter Laravel API | [starter-laravel-api](https://github.com/websanova/starter-laravel-api) | [api](https://starter-laravel-api.websanova.com) | | Starter Vue SPA | [starter-vue-spa](https://github.com/websanova/starter-vue-spa) | [app](https://starter-vue-spa-app.websanova.com), [admin](https://starter-vue-spa-admin.websanova.com) | ## Flows The starter-flows repo is a separate set of feature specs, implementation-agnostic so one spec covers both the API and the app. Nothing here depends on it, but if you point your `CLAUDE.local.md` at a local clone, the `/flow` command will compare any flow against this repo and tell you what's built, what's missing, and what the app expects it to expose. ## Notes - The commands are experimental and the format is still being tinkered with. The main idea is to not have the agent run wild without explicit go aheads and to remove reptitive explanations to help streamline workflow. Open to suggestions and feedback. ## Features * **API Structure** - JSON-only with consistent response shapes, admin endpoints on `/admin`, and translatable strings. * **Public Settings** - Centralized app settings on a public `/settings` endpoint for reuse across clients. * **Rate Limiting** - Global throttle on all routes, stricter on auth routes keyed by email + IP. * **Search (Fulltext)** - Drop-in fulltext search for any model that stays in sync automatically, used on users out of the box. * **Token Auth (Sanctum)** - Register, login, logout, refresh, and password reset with configurable token expiration. * **Account Verification** - Code-based, multi-channel verification (email wired, SMS scaffolded), each channel set to disabled, auto, or required. * **Account Self-Management** - Profile, password, avatar, email change, locale/timezone, and self-delete with a grace period. * **Preferences** - Saved client display state with defaults in config, stored partial so adding or removing one needs no migration, and scoped to keep admin preferences out of the app payload. * **User Delete & Restore** - Soft delete, anonymize, or hard delete, with admin restore, auto-restore on login, and scheduled prune. * **Sample CRUD (Bookmarks & Tags)** - Reference resources showing relationships, ownership scoping, filtering, sorting, and pagination. * **Plans** - Freemium, trial, or required modes with prices synced from the provider and optional automatic tax. * **Subscriptions** - Subscribe, swap, cancel, and resume with multiple billing intervals, client-built Stripe checkout, and enforced feature limits. * **Billing Providers (Cashier/Stripe)** - Stripe via Cashier out of the box, swappable without touching the rest of the app. * **Promotion Codes** - Validated against the provider and entered in checkout, with admin apply/clear on existing subscriptions. * **Webhooks (Cashier/Stripe)** - Idempotent webhooks that back up client sync and catch outside changes, with local dev needing no tunnel. * **Roles and Permissions (Spatie)** - Super and admin roles with coarse permissions and per-target checks. * **Stats** - Scheduled stats grouped by resource with date range breakdowns and per-plan subscription stats. * **Mail (Mailpit)** - Any SMTP provider, with a local mail catcher and test command for dev. * **Notifications** - Database-backed in-app notifications plus email for account and plan lifecycle events. * **Backups (Spatie)** - Daily database backups with scheduled cleanup. * **Localization (i18n)** - Multi-locale responses and per-user localized emails, add a language by dropping in a lang folder. * **File Storage (S3)** - Off-server storage for AWS or DigitalOcean Spaces, with avatars cropped and resized on upload. * **Dev Environment** - Dockerized with MySQL, Redis, Mailpit, and Stripe CLI, plus a helper script and Pest test suite. For the full breakdown, see the [features overview](https://websanova.com/docs/starter-api/intro/features). ## License MIT - see [LICENSE](LICENSE). --- Built and maintained by Rob at [Websanova](https://www.websanova.com). I take freelance and contract work, including MVP projects built on the Starters. Check out the [hire page](https://www.websanova.com/hire) for more info.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

sage
WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and block editor support
Laravel · 启动器

wave
Wave - The Software as a Service Starter Kit, designed to help you build the SAAS of your dreams 🚀 💰
Laravel · SaaS

filament-starter
A beautiful starting point for your next TALL stack project using Filament. ⚡
Laravel · 启动器

electrik
Laravel SaaS starter kit: auth, teams, Stripe billing, and Slate 3 — Composer package for Laravel 12
Laravel · SaaS

php-saas
The everything-included starter kit for your next idea
Laravel · SaaS

filament-jetstream
A Laravel starter kit built with Filament inspired by Jetstream.
Laravel · 启动器
