projx / laravel
CLAUDE.md71 starsChanged 4 months agoMITView on GitHub
Stack-scoped notes. The root ../CLAUDE.md carries cross-cutting standards — read both, they compose. This directory is a projx template: a working backend whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects. Same runtime surface as the sibling backends (auto-CRUD, {detail, request_id} envelope, soft-delete, lifecycle hooks) with Laravel idioms. composer install → ./vendor/bin/pint --test → ./vendor/bin/phpstan analyse --level=8 → ./vendor/bin/pest --coverage --min=80 (c
In this repository15 other files it gives its agents.
- admin-panel/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- cli/CLAUDE.mdCLAUDE.md
- e2e/CLAUDE.mdCLAUDE.md
- express/CLAUDE.mdCLAUDE.md
- fastapi/CLAUDE.mdCLAUDE.md
- fastify/CLAUDE.mdCLAUDE.md
- go/CLAUDE.mdCLAUDE.md
- infra/CLAUDE.mdCLAUDE.md
- mobile/CLAUDE.mdCLAUDE.md
- nextjs/CLAUDE.mdCLAUDE.md
- rust/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- vitejs/CLAUDE.mdCLAUDE.md
- projxSkill
The file
Files
laravel — Laravel / PHP backend (projx template)
Stack-scoped notes. The root
../CLAUDE.mdcarries cross-cutting standards — read both, they compose.This directory is a projx template: a working backend whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects. Same runtime surface as the sibling backends (auto-CRUD,
{detail, request_id}envelope, soft-delete, lifecycle hooks) with Laravel idioms.
Stack
- Language — PHP 8.3+ (CI pins 8.3 via
shivammathur/setup-php) - Framework — Laravel 12 (slim skeleton:
bootstrap/app.phpconfigure pattern) - ORM / DB — Eloquent + Postgres (
eloquentis the canonical PHP ORM) - Auth — Sanctum-ready; JWT via
firebase/php-jwt^7 (app/Services/JwtVerifier.php) - Config — DB-backed encrypted
service_configs(app/Services/ServiceConfig.php), env bootstrap-only - Errors —
app/Exceptions/Handler.phprenders{detail, request_id}forapi/* - Runtime — FrankenPHP (single-binary HTTP), multi-stage
Dockerfile - Test — Pest 3 (PHPUnit 11 under it); static analysis Larastan 3 (PHPStan level 8); format Pint
Layout
| Path | What it holds |
bootstrap/app.php | Application::configure() — routing, middleware (RequestId, Sanctum), exceptions |
bootstrap/cache/ | Compiled-container cache dir (must exist for boot — keep the .gitignore) |
app/Http/Middleware/ | RequestId.php, auth/authz, CORS, per-user rate-limit |
app/Exceptions/ | Handler.php, AppException subclasses (status-carrying) |
app/Services/ | JwtVerifier.php, ServiceConfig.php (AES-256-GCM, cross-language wire-format) |
app/Entities/ | EntityRegistry.php, EntityConfig.php, AutoRoutesController.php, QueryBuilder.php, AuditLogger.php |
app/Models/ | User.php, ServiceConfig.php, AuditLog.php, example Post |
app/Providers/ | AppServiceProvider.php (// projx-anchor: providers), EntityServiceProvider.php |
routes/api.php | /api/v1 mount + // projx-anchor: routes |
database/migrations/ | service_configs + posts + audit_logs (schema, not pre-baked app migrations) |
tests/ | Pest Unit/ (JwtVerifier, RequestId, Cors, RateLimit, ServiceConfig, Authenticate, Authz); Integration/ (audit-log, real Postgres) |
phpstan.neon / pint.json / phpunit.xml | Gate configs |
Quality gates (root §"Per-template gates")
composer install → ./vendor/bin/pint --test → ./vendor/bin/phpstan analyse --level=8 → ./vendor/bin/pest --coverage --min=80 (coverage via pcov). Locally bash ../scripts/ci-local.sh laravel (skips cleanly when php/composer absent).
Things that bite
composer installdoes a freshcomposer update(no lock shipped to scaffolds) — version constraints must resolve clean. Composer 2.8+ blocks advisory-affected versions by default; keep deps on actively-patched majors (Laravel 12,firebase/php-jwt^7) or resolution fails before any gate runs.bootstrap/cache/must exist orartisan package:discover(a post-autoload-dump script) fails. The dir ships with a.gitignore(*except itself).strict_types=1at the top of every PHP file; type + return declarations everywhere (PHPStan level 8 enforces).- Runtime creds are DB-backed (
service_configs); env is bootstrap-only — JWT secret reads go throughServiceConfig, notenv(). - Audit logging is wired into the central write path (
AutoRoutesController→AuditLogger), not an Eloquent observer — observers are bypassed by the bulk delete's Query-BuilderwhereIn(...)->delete(), sobulkDestroypre-fetches matching rows and records oneaudit_logsDELETE per affected record. Every single + bulk create/update/delete writes one row per record.AuditLogger::SKIP_TABLES(audit_logsonly) prevents an audit-of-audit loop and is a separate concern from any scoping skip set; the action is classified per write path, never an allowlist. - Audit tests live in
tests/Integration/and need real Postgres (AUDIT_DB_*env, default DBprojx_audit_laravel). They self-skip when Postgres is unreachable, so the SQLiteUnit/Featuresuites stay green without it; CI andci-local.sh laravelprovision the DB so they actually run. --auth=laraveloverlays the full auth feature from../features/auth/laravel/.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

