Compare commits

...

381 commits

Author SHA1 Message Date
rosslh
550d234eaa chore(ci): use Forgejo build and CDN publishing
All checks were successful
Build MapleDeploy Coolify Image / build (push) Successful in 1m10s
2026-07-25 00:00:46 -04:00
rosslh
b1d00b6637 feat(auth): add dashboard-managed Coolify access 2026-07-25 00:00:46 -04:00
rosslh
600148e72c fix(dns): use Canadian Shield DNS defaults 2026-07-24 23:58:20 -04:00
rosslh
34bb7d1039 fix(telemetry): disable upstream telemetry 2026-07-24 23:58:20 -04:00
rosslh
98dc9a3375 fix(update): use MapleDeploy CDN and registry artifacts 2026-07-24 23:58:20 -04:00
rosslh
07ac994f25 style(theme): apply MapleDeploy palette and fonts 2026-07-24 23:57:17 -04:00
rosslh
f81bbed7ec feat(branding): apply MapleDeploy UI branding 2026-07-24 23:57:17 -04:00
Andras Bacsai
2180a5e7ef
fix(traefik): track v3.7 and security patch updates (#11029) 2026-07-24 09:02:30 +02:00
Andras Bacsai
f8df830e5e fix(traefik): track v3.7 security updates
Track v3.7 and patch releases for supported Traefik branches.
Set the stable Coolify v4 version to 4.1.2.
2026-07-24 09:00:18 +02:00
Andras Bacsai
da29fdcc69
ci(images): add edge tag for v4.x SHA builds (#11022) 2026-07-23 19:15:48 +02:00
Andras Bacsai
1fc294b908
refactor(ui): remove deploy confirmation modals (#11023) 2026-07-23 19:13:08 +02:00
Andras Bacsai
ee86c69f15 ci: tag v4.x SHA images as edge
Also publish the moving edge tag on GHCR and Docker Hub when the SHA build runs on v4.x, so edge always points at the latest production-line multi-arch image.
2026-07-23 19:11:20 +02:00
Andras Bacsai
ec1762b083 chore: prepare for PR 2026-07-23 19:10:58 +02:00
Andras Bacsai
004c3ab3bc
internal stuffs (#10992) 2026-07-20 12:56:16 +02:00
Andras Bacsai
160278c7eb ci: support main branch build and changelog workflows 2026-07-20 12:54:25 +02:00
Andras Bacsai
94a95cdf54 docs(release): clarify branch strategy and SHA build flow 2026-07-20 12:39:42 +02:00
Andras Bacsai
9b284973e1
feat(backups): add scheduled storage volume backups (#10946) 2026-07-20 12:04:50 +02:00
Andras Bacsai
bf72fd5d88 refactor(backups): centralize storage deletion guard 2026-07-19 23:20:46 +02:00
Andras Bacsai
4e03be755d Merge remote-tracking branch 'origin/next' into volume-backups-server-s3 2026-07-19 23:16:00 +02:00
Andras Bacsai
72a0a57f0e fix(backups): enforce authorization and safe retention
- Gate volume backup retention and S3 controls by update permission
- Preserve backup records when S3 deletion fails
- Share SFTP download streaming with consistent missing-file handling
- Handle schedule creation errors and link service database backups
2026-07-19 23:15:55 +02:00
Andras Bacsai
24bc4b0462 docs(release): document SHA image promotion workflow 2026-07-19 23:13:33 +02:00
Andras Bacsai
99a8a96e7f Merge remote-tracking branch 'origin/next' into volume-backups-server-s3 2026-07-19 23:02:59 +02:00
Andras Bacsai
b53ae426b8
ci(release): promote SHA-tagged images on release (#10988) 2026-07-19 23:01:52 +02:00
Andras Bacsai
7716e65eea ci(release): promote SHA-tagged images on release
Publish branch builds under immutable commit SHA tags, then promote the
released image to its version tag and stable releases to latest.
2026-07-19 23:00:47 +02:00
Andras Bacsai
994eee8377 fix(backups): retain volume backups without server 2026-07-19 22:35:33 +02:00
Andras Bacsai
b97a97e955 Merge remote-tracking branch 'origin/next' into volume-backups-server-s3 2026-07-19 21:45:26 +02:00
Andras Bacsai
f715fb69bb
v4.2 (#10872) 2026-07-19 21:21:40 +02:00
Andras Bacsai
a92ca6e3b8 version ++ 2026-07-19 21:18:55 +02:00
Andras Bacsai
0633b543ee feat(api): require POST for state-changing endpoints
Make start/stop/restart, deploy, enable/disable, and server validate
POST-only, with GET returning 405. Server validate accepts optional
install and uses ValidateAndInstallServerJob. Update OpenAPI and tests.
2026-07-19 11:42:04 +02:00
Andras Bacsai
e2c2180f4f fix(dev): support root bind mounts and LAN Vite access
Keep the dev container as root for s6 init so composer can create
vendor/ on root-owned mounts, then chown writable paths to www-data.
Move init-setup into a shell script and expose VITE_HOST/PORT for
remote HMR (LAN/Tailscale) with Vite listening on 0.0.0.0.
2026-07-18 20:56:01 +02:00
Andras Bacsai
662633399f Merge remote-tracking branch 'origin/next' into volume-backups-server-s3 2026-07-18 16:07:26 +02:00
Andras Bacsai
28f8867567 feat(api): add volume backup schedule delete endpoints
Expose DELETE for application, database, and service storage backup
schedules (with OpenAPI docs), reject storage deletes while schedules
exist, skip retention cleanup when no limits are set, and remove S3
archives using the execution’s S3 storage.
2026-07-16 21:44:48 +02:00
Andras Bacsai
913d033c75
fix(resources): clarify build server hosting restrictions (#10961) 2026-07-16 21:35:23 +02:00
Andras Bacsai
fab012b5c8 fix(backups): allow volume backup delete without password when 2FA off
Skip empty-password rejection so delete works when two-step confirmation is disabled; cover with a feature test.
2026-07-16 14:43:02 +02:00
Andras Bacsai
ac36a59088 fix(backups): pin S3 per volume execution and harden deletes
Store s3_storage_id on scheduled volume backup executions so retention
and recovery use the S3 that received the upload. Extract
DeleteScheduledVolumeBackup for UI and resource deletion, and isolate
database backup retention failures so cleanup errors do not fail the job.
2026-07-16 14:30:58 +02:00
Andras Bacsai
8cfa41a7d9 fix(backups): sync Backup Now with live database status
Subscribe BackupEdit to database status broadcasts and refresh the
database status so the Backup Now control updates without a full reload.
2026-07-16 14:01:34 +02:00
Andras Bacsai
ddbed9f8a6 Merge remote-tracking branch 'origin/next' into volume-backups-server-s3 2026-07-16 13:47:15 +02:00
Andras Bacsai
7d699818e8 fix: harden Vultr create, Gmail identity, and provider retries
Wrap Vultr server creation in DB transactions and delete the remote
instance when local persistence fails (API and Livewire). Scope
plus/dot email normalization to gmail.com/googlemail.com only.
Use throw:false on DigitalOcean/Vultr HTTP retries, and normalize
service log line counts via normalizeLogLines.
2026-07-16 13:42:53 +02:00
Andras Bacsai
2719d66042 feat: add ClickHouse backups and cloud ops tools
Enable scheduled ClickHouse backups across the job, API, and UI, and
guard unsupported database types via isBackupSolutionAvailable().
Convert Stripe subscription sync from a job to an action with clearer
discrepancy resolution, and add cloud:export-users plus
cloud:cleanup-unverified-users with tests.
2026-07-16 11:57:52 +02:00
Andras Bacsai
6ae1b4eba2 fix(backups): show setup prompt when no S3 storage is available 2026-07-15 20:36:23 +02:00
Andras Bacsai
91d97bfad2 fix(status): prevent health badge row height expansion 2026-07-15 20:07:51 +02:00
Andras Bacsai
e0f85de3fe fix(backups): move S3 retention settings to retention page 2026-07-15 20:00:10 +02:00
Andras Bacsai
aef70eb053 refactor(backups): consolidate volume backup retention columns 2026-07-15 19:55:29 +02:00
Andras Bacsai
9d04bb7e59 fix(backups): rename storage backup page heading 2026-07-15 18:17:54 +02:00
Andras Bacsai
41eee14bd3 fix(backups): redirect to executions after manual backup queueing
Queue manual database and volume backups before redirecting to their execution views, including schedules with unusable S3 storage.
2026-07-15 17:39:48 +02:00
Andras Bacsai
d7385ad0c4 feat(backups): support scheduled backups for application storage targets
Add polymorphic volume backup scheduling for persistent volumes and directories, expose schedule management via API, and reorganize backup configuration and execution views.
2026-07-15 17:34:22 +02:00
Andras Bacsai
995ec5fbb6 Merge remote-tracking branch 'origin/next' into volume-backups-server-s3 2026-07-15 16:33:51 +02:00
Andras Bacsai
4eec1ac547 fix(backups): stop containers during volume backup creation
Track and recover stopped containers across interrupted backup executions.
2026-07-15 15:59:35 +02:00
Andras Bacsai
63961e0799 feat(backups): add scheduled persistent volume backups 2026-07-15 15:47:57 +02:00
Andras Bacsai
908b5cc09d feat(api): add service database management endpoints
Add service database CRUD, logs, and lifecycle actions, and document service application operations with OpenAPI tests.
2026-07-15 12:29:58 +02:00
Andras Bacsai
64667574f6 fix(api): correct service and application OpenAPI schemas 2026-07-15 12:29:20 +02:00
Andras Bacsai
05dc2c65f6
chore(deps): bump web-auth/webauthn-lib from 5.3.3 to 5.3.5 (#10901) 2026-07-14 14:18:00 +02:00
Andras Bacsai
198e9f8fff fix(environment-variable): align settings and actions responsively 2026-07-14 14:02:34 +02:00
Andras Bacsai
59605fe7d3 fix(environment-variable): keep delete button compact 2026-07-14 13:58:15 +02:00
Andras Bacsai
34e6a6dd5d feat(api): add application settings to application endpoints 2026-07-14 13:44:45 +02:00
Andras Bacsai
99e255a572 fix(deployment): detect application configuration changes consistently
Expand configuration snapshots, handle defaults from older snapshots, and refresh configuration state after Livewire setting changes.
2026-07-14 12:54:31 +02:00
Andras Bacsai
5381287606
Update configuration for compatibility with EspoCRM v10 (#10848) 2026-07-13 15:06:35 +02:00
Andras Bacsai
683a2ce2e9
feat(services): bump alexandrie to version 8.10.0 (#10864) 2026-07-13 15:06:16 +02:00
Andras Bacsai
47a292486c chore(deps): bump NGINX package to 1.31.2-r1 2026-07-13 10:54:31 +02:00
Andras Bacsai
c8a332a3bc fix(servers): isolate cloud status checks from SSH checks
Track provider state independently, skip SSH work for placeholder IPs, and clean up failed cloud server provisioning.
2026-07-11 22:52:10 +02:00
Andras Bacsai
e01b8a057e fix(servers): retain cloud instances awaiting IPs
Persist DigitalOcean, Hetzner, and Vultr servers before public IP
assignment, then backfill placeholder addresses from provider state.

Treat partial Sentinel snapshots as non-authoritative and document the
destinations API with OpenAPI schemas.
2026-07-11 21:35:10 +02:00
dependabot[bot]
bd82b4c1cd
chore(deps): bump web-auth/webauthn-lib from 5.3.3 to 5.3.5
Bumps [web-auth/webauthn-lib](https://github.com/web-auth/webauthn-lib) from 5.3.3 to 5.3.5.
- [Commits](https://github.com/web-auth/webauthn-lib/compare/5.3.3...5.3.5)

---
updated-dependencies:
- dependency-name: web-auth/webauthn-lib
  dependency-version: 5.3.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-10 18:35:42 +00:00
Andras Bacsai
d3fbb32c52 feat(cdn): sync release metadata through BunnyCDN
Replace the legacy sync:bunny flags with an interactive CDN sync flow for service templates and release metadata. Serve official service templates from the Coollabs CDN, update version metadata, and remove obsolete helper scripts.
2026-07-10 14:29:11 +02:00
Andras Bacsai
e4f925ebbf fix(meta): serve releases metadata from Coollabs CDN 2026-07-10 10:49:59 +02:00
Andras Bacsai
dd10a90d8c fix(meta): update social preview image URL 2026-07-10 10:48:06 +02:00
Andras Bacsai
bcadcc9200 docs(readme): serve sponsor images from Coollabs CDN 2026-07-10 10:47:38 +02:00
Andras Bacsai
2a0183bfad Revert "feat(notifications): deduplicate repeated email alerts"
This reverts commit 8c1405e168.
2026-07-09 13:19:48 +02:00
Andras Bacsai
8c1405e168 feat(notifications): deduplicate repeated email alerts
Add notification-level deduplication keys and TTLs for deployment, backup,
server, container, scheduled task, SSL, token, and transactional emails.
Apply deduplication in email channels before sending rendered messages.
2026-07-08 15:23:14 +02:00
Andras Bacsai
ee620a5413
fix(github): honor skip flags for PR preview syncs (#10873) 2026-07-08 15:06:31 +02:00
Andras Bacsai
e325f93662 Merge remote-tracking branch 'origin/next' into 10870-pr-previews-ignore 2026-07-08 15:06:16 +02:00
Andras Bacsai
f24439f9c8 test(github): cover PR previews without skip ci 2026-07-08 14:44:40 +02:00
Andras Bacsai
3f960d94c3 fix(github): skip opened PR previews with skip ci 2026-07-08 14:41:37 +02:00
Andras Bacsai
0217e2b0c0 feat(server): improve private key and cloud link flows
Add server private key generation from the dropdown, prevent deleting
private keys that are still in use, and close cloud provider link modals
after successful linking.
2026-07-08 13:35:09 +02:00
Andras Bacsai
f4f4274cee fix(github): skip PR previews from head commit flags 2026-07-08 13:31:23 +02:00
Andras Bacsai
9b8aeb4758 feat(server): add private key creation to IP server form 2026-07-08 13:05:29 +02:00
Andras Bacsai
e200d881f5 feat(security): add editable cloud credential pages
Add dedicated show/edit pages for cloud provider tokens and cloud-init
scripts, including descriptions and UUID routes.

Generate private keys directly from the index and surface cloud provider
API loading errors in server creation flows.
2026-07-08 12:58:27 +02:00
Andras Bacsai
7236cb8228 feat(server): add dedicated server creation flow 2026-07-08 12:20:56 +02:00
Andras Bacsai
18f0f7f6be
feat(digitalocean): add droplet provisioning support (#10871) 2026-07-08 10:50:25 +02:00
Andras Bacsai
c303c34cfd feat(digitalocean): add droplet provisioning support 2026-07-08 10:42:58 +02:00
Andras Bacsai
5936874ffd
feat(vultr): add cloud provider integration (#10533) 2026-07-08 10:24:10 +02:00
Andras Bacsai
2dd264f802 fix(vultr): remove duplicate deletion error log 2026-07-08 10:23:31 +02:00
Andras Bacsai
d90a0a288c fix: align server mobile menu spacing 2026-07-08 09:49:16 +02:00
Andras Bacsai
d74206f4a9 Merge remote-tracking branch 'origin/next' into feature/vultr-cloud-provider 2026-07-08 09:48:18 +02:00
Andras Bacsai
b0f0f7d8d0 feat: harden auth flows and server mobile navigation
Add normalized email identity rate limiting for registration and forgot-password requests, and refresh Sentinel status from restart broadcasts.

Rework server sidebars and navbar for mobile menus and active status visibility.
2026-07-08 09:42:52 +02:00
Andras Bacsai
94079c90f2 docs(readme): refresh sponsor listings 2026-07-08 00:03:42 +02:00
Andras Bacsai
6ed92cb97a fix(vultr): validate public network and token scope
Require IPv6 when public IPv4 is disabled, constrain cloud token
lookup by team and provider during deletion, and encode Vultr instance IDs
in API paths.
2026-07-07 21:39:57 +02:00
Andras Bacsai
31f904ef9f Merge remote-tracking branch 'origin/next' into feature/vultr-cloud-provider 2026-07-07 21:23:07 +02:00
Andras Bacsai
b93f1090ad
feat(api): add POST /move endpoints to relocate resources between environments (#8968) 2026-07-07 21:21:11 +02:00
Andras Bacsai
6872f63f5f fix(api): audit moved resources 2026-07-07 21:20:41 +02:00
Andras Bacsai
5699b78567 fix(api): stop auditing sentinel metric pushes 2026-07-07 21:17:29 +02:00
Andras Bacsai
f244b5e25d test(api): assert target env authorization on moves 2026-07-07 21:07:50 +02:00
Andras Bacsai
676161a627 fix(api): authorize target environment moves 2026-07-07 20:56:55 +02:00
Andras Bacsai
cf63c7d154 Merge remote-tracking branch 'origin/next' into feat/api-move-resources-between-projects 2026-07-07 18:13:37 +02:00
Andras Bacsai
0cca267953
feat(api): Service Application Management API (#9249) 2026-07-07 18:05:57 +02:00
Andras Bacsai
9f13434273 fix(docker): escape container status commands
Build container status commands with escaped container names in the
Docker helper so callers can pass raw identifiers consistently.
2026-07-07 18:00:40 +02:00
Andras Bacsai
a165e03d06 fix(service-apps): harden updates and docker commands
Escape service application lifecycle command arguments for deploy, restart, stop, and log status checks.
Validate API update payloads from JSON/form data before applying allowed fields, preserving explicit boolean and null values.
Add coverage for service application API authorization, team isolation, validation, and command escaping.
2026-07-07 15:10:24 +02:00
Andras Bacsai
95a3c453d8 Merge remote-tracking branch 'origin/next' into 9249-pr-investigation 2026-07-07 14:45:48 +02:00
Andras Bacsai
e81a2c6996
feat(cloud-provider): Add support for Hetzner firewalls, internal networks and backups when creating the Server (#9646) 2026-07-07 14:42:29 +02:00
Andras Bacsai
a8000ac2ad fix(hetzner): require at least one public IP protocol 2026-07-07 14:41:17 +02:00
Andras Bacsai
c9ffa0db96 Merge remote-tracking branch 'origin/next' into feat/hetzner-firewalls-and-internal-networks 2026-07-07 14:37:54 +02:00
Andras Bacsai
0b33eb4e9c fix(ui): constrain helper popup within viewport 2026-07-07 14:37:33 +02:00
Andras Bacsai
b939e09f12 refactor(hetzner): move advanced options into dropdown 2026-07-07 14:36:11 +02:00
Andras Bacsai
d723a52d9c fix(hetzner): secure token-backed option fetches
Authorize stored Hetzner cloud provider tokens before fetching
firewalls or networks, hide provider error details, and keep server
creation intact if backup activation fails.

Collapse advanced Hetzner server options by default while preserving
visibility when advanced values are selected.
2026-07-07 14:24:15 +02:00
Andras Bacsai
5dc697c428
feat(api): add tag management endpoints for applications, databases, and services (#9275) 2026-07-07 14:12:13 +02:00
Andras Bacsai
aded45acbe Merge remote-tracking branch 'origin/next' into feat/api/tag-management 2026-07-07 14:02:45 +02:00
Andras Bacsai
11b35ba3c1 feat(api): add tags to resource creation
Normalize tag names before attaching them, reject names that are too short
after sanitization, and return 404 when removing tags not attached to the
resource.

Adds a per-team unique tag-name index and migrates duplicate tags onto the
kept record before creating the constraint.
2026-07-07 13:56:33 +02:00
Andras Bacsai
2ad11fdd9a Merge remote-tracking branch 'origin/next' into feat/hetzner-firewalls-and-internal-networks 2026-07-07 13:47:51 +02:00
Andras Bacsai
c58b4fd69c Merge remote-tracking branch 'origin/next' into feature/vultr-cloud-provider 2026-07-07 13:44:37 +02:00
Andras Bacsai
6f52f7a22f
fix(api): hide sensitive fields by default, expose via makeVisible for privileged tokens (#9893) 2026-07-07 13:31:41 +02:00
Smaug
915af96981
feat(templates): bump alexandrie to version 8.10.0
* bump frontend to v8.10.0
* bump backend to v8.10.0
* bump rustfs to 1.0.0-beta.8
2026-07-07 13:24:35 +02:00
Andras Bacsai
ff976a134f Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-07-07 12:56:19 +02:00
Andras Bacsai
9a2c432c79 fix(api): expose sensitive fields for privileged tokens
Privileged API tokens can read hidden resource fields in environment and
resource responses, including instance-admin team tokens with team_id 0.

Configuration hashes now include hidden environment variable values so
secret edits trigger restart detection.
2026-07-07 12:53:34 +02:00
Andras Bacsai
f617e58401 Merge remote-tracking branch 'origin/next' into feat/api/tag-management
# Conflicts:
#	app/Http/Controllers/Api/ApplicationsController.php
2026-07-07 12:49:19 +02:00
Andras Bacsai
3324999623
feat(api): add is_preview_deployments_enabled on applications (#10188) 2026-07-07 12:41:48 +02:00
Andras Bacsai
00a3738ec7 Merge remote-tracking branch 'origin/next' into api-application-preview-deployments 2026-07-07 12:38:37 +02:00
Andras Bacsai
cf12e1d7ef feat(api): allow preview deployments on app create
Expose is_preview_deployments_enabled in the application create API
schema and validation, and skip deployment configuration column casts on
sqlite migrations.
2026-07-07 12:36:35 +02:00
Andras Bacsai
e9bef8443b fix(api): hide nested server secrets in database responses
Prevent database detail responses from exposing log drain and Sentinel
settings when callers lack sensitive read access.
2026-07-07 12:34:09 +02:00
Andras Bacsai
2caa5e67ff
fix(github): derive API URLs from GitHub HTML hosts (#10610) 2026-07-07 12:29:15 +02:00
Andras Bacsai
f3ca349765
fix: accept underscores in domain hostnames for API URL validation (#10663) 2026-07-07 12:27:29 +02:00
Andras Bacsai
21bd8fa2bc fix(github): reject malformed app URL origins 2026-07-07 12:24:52 +02:00
Andras Bacsai
b50839d451 Merge remote-tracking branch 'origin/next' into fix/url-validator-underscore-hostnames 2026-07-07 12:24:32 +02:00
Andras Bacsai
bce871d991 fix(domains): reject non-HTTP URL schemes 2026-07-07 12:20:26 +02:00
Andras Bacsai
d01e3a9730
fix(parsers): populate docker_compose_domains for API-created Docker Compose apps (#9300) 2026-07-07 12:17:52 +02:00
Andras Bacsai
d657c10df3
fix(api): allow source commit build setting (#10551) 2026-07-07 12:12:32 +02:00
Andras Bacsai
59b158381c fix(api): preserve source commit flag until cleanup 2026-07-07 12:12:20 +02:00
Andras Bacsai
6c42ca82cb
fix: only strip git_host from repository_url when git_host is github.com (#10274) 2026-07-07 12:11:45 +02:00
Andras Bacsai
2741bc1d0d test(api): cover public git repository URL storage 2026-07-07 12:10:38 +02:00
Andras Bacsai
76a4c1484d
fix(deploy): cast force param as boolean to prevent cache bust on every deploy (#9909) 2026-07-07 12:08:29 +02:00
Andras Bacsai
6baabf9eda fix(api): document source commit build option 2026-07-07 12:08:07 +02:00
Andras Bacsai
15684fdbfe
feat(api): add endpoint to retrieve database and service logs (#6293) 2026-07-06 23:59:02 +02:00
Andras Bacsai
ff5cfd4253 fix(api): normalize log endpoint query handling
Clamp log line counts, parse timestamp flags consistently, and filter
service subcontainers by Coolify labels. Document log endpoint timestamp
parameters and database/service log routes in OpenAPI.
2026-07-06 23:58:12 +02:00
Andras Bacsai
adc4b3091f Merge remote-tracking branch 'origin/next' into feat/database-service-logs-endpoint 2026-07-06 23:29:54 +02:00
Andras Bacsai
b6a4c7383a
fix(env): preserve empty service variable values (#10850) 2026-07-03 20:47:18 +02:00
Taras Machyshyn
d2206cd93c Update configuration for compatibility with EspoCRM v10 2026-07-03 15:15:43 +03:00
Andras Bacsai
1adeed2a48 fix(github): preserve custom app API URLs 2026-07-03 12:01:16 +02:00
Andras Bacsai
eddcbe819b fix(parser): populate compose domains from service env keys 2026-07-03 11:57:02 +02:00
Andras Bacsai
9b060958aa
fix(ray): remove Ray debug hooks from runtime (#10847) 2026-07-03 11:40:20 +02:00
Andras Bacsai
e551f9c176 Merge remote-tracking branch 'origin/next' into fix/docker-compose-domains-api-9211 2026-07-03 11:32:41 +02:00
Andras Bacsai
29c122b31a fix(api): return deployment UUID strings directly 2026-07-03 11:31:49 +02:00
Andras Bacsai
a7dddccd2e Merge remote-tracking branch 'origin/next' into ghe-support-helpers 2026-07-03 10:26:58 +02:00
Andras Bacsai
b5ba40b049 Merge remote-tracking branch 'origin/next' into fix/docker-compose-domains-api-9211 2026-07-03 10:26:19 +02:00
Andras Bacsai
8ce054c10c
fix(git): use cloud install path for ghe apps (#10576) 2026-07-03 10:24:04 +02:00
Andras Bacsai
b90380f542 Merge remote-tracking branch 'origin/next' into ghe-support-helpers 2026-07-03 10:15:29 +02:00
Andras Bacsai
67693acce7
fix(parser): preserve file volume state (#10843) 2026-07-03 10:14:39 +02:00
Andras Bacsai
d73649ca15 Merge remote-tracking branch 'origin/next' into fix-ghe-app-install-url 2026-07-03 10:10:39 +02:00
Andras Bacsai
08e0d02643 Merge remote-tracking branch 'origin/next' into next 2026-07-03 10:09:50 +02:00
Andras Bacsai
4435a46f07 fix(server): hide sentinel status before validation 2026-07-03 10:08:55 +02:00
Andras Bacsai
58f6f9e05b
feat(dev): add Lima testing server fixtures (#10844) 2026-07-03 10:07:55 +02:00
Andras Bacsai
bf37db3b5f
fix(auth): validate invitation magic link tokens (#10651) 2026-07-03 09:38:48 +02:00
Andras Bacsai
c0866d4cb3 fix(auth): preserve invite login with database sessions 2026-07-03 09:38:05 +02:00
Andras Bacsai
bec871cf78 fix(team): keep invite link root element 2026-07-02 18:56:57 +02:00
Andras Bacsai
eb56287b57 Merge remote-tracking branch 'origin/next' into 10633-invitation-link-redirect 2026-07-02 18:55:25 +02:00
Andras Bacsai
bb2f70ac3b
fix(railpack): isolate buildx from Docker client env (#10840) 2026-07-02 18:53:00 +02:00
Andras Bacsai
cf6f5a2678
feat(registry): add configurable docker registry url (#9017) 2026-07-02 18:52:46 +02:00
Andras Bacsai
d32d7cf3d2
Improve application URL handling (#10836) 2026-07-02 18:41:13 +02:00
Andras Bacsai
99f60228ad fix(api): avoid lazy loading nested server secrets 2026-07-02 17:47:22 +02:00
Andras Bacsai
c6c7ec1c31 fix(security): validate application domains safely
Use shared domain validation and normalization for application, service, and
preview domains so unsafe host input is rejected consistently.

Cover command-substitution payloads in application domain tests.
2026-07-02 17:47:04 +02:00
Andras Bacsai
cc4f666ba2 Merge remote-tracking branch 'origin/next' into improve-application-url-handling 2026-07-02 17:40:31 +02:00
Andras Bacsai
954c1e369c
fix(env-vars): avoid service preview variable lookups (#10837) 2026-07-02 17:39:16 +02:00
Andras Bacsai
d5395f0500 fix(services): preserve template keys for selection 2026-07-02 17:16:40 +02:00
Andras Bacsai
ed6352682e Merge remote-tracking branch 'origin/next' into improve-application-url-handling 2026-07-02 16:57:14 +02:00
Andras Bacsai
cd95ac3d0d test: cover case-sensitive application URL paths 2026-07-02 16:56:49 +02:00
Andras Bacsai
bbff70c8d0 fix: improve application URL handling 2026-07-02 16:52:07 +02:00
Andras Bacsai
ec34c5192f
Add internal endpoint controls (#10835) 2026-07-02 16:49:14 +02:00
Andras Bacsai
3988ad6921 fix(webhooks): resolve hostnames using custom DNS servers
Keep webhook SSRF DNS checks active when general DNS validation is disabled, and include localhost loopback resolution in safe URL validation.
2026-07-02 16:47:55 +02:00
Andras Bacsai
0bf97df9af feat: add internal endpoint controls 2026-07-02 16:35:39 +02:00
Andras Bacsai
7a853efa79
chore: inspect PR context (#10834) 2026-07-02 16:27:06 +02:00
Andras Bacsai
c4772cce49
chore: improve contributor guidelines and issue templates (#8577) 2026-07-02 16:22:25 +02:00
Andras Bacsai
13172849e1 Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-07-02 15:57:43 +02:00
Andras Bacsai
6871160623 fix(api): gate sensitive storage and GitHub fields
Expose GitHub app secrets and file storage content only when the request has sensitive read access. Hide LocalFileVolume content by default and resolve application UUIDs from route parameters.
2026-07-02 15:50:43 +02:00
Andras Bacsai
438eeefa73
feat(api): add REST endpoints for destinations (#10405) 2026-07-02 15:34:30 +02:00
Andras Bacsai
70021c8d5e fix(api): handle destination create races as conflicts 2026-07-02 15:33:01 +02:00
Andras Bacsai
ae839198d6
feat(mcp): add per-team server toggle (#10771) 2026-07-02 15:19:07 +02:00
Andras Bacsai
88d5aff018 Merge remote-tracking branch 'origin/next' into team-level-mcp-enablement 2026-07-02 15:15:11 +02:00
Andras Bacsai
4ef884e1ac Merge remote-tracking branch 'origin/next' into feat/api-destinations 2026-07-02 15:14:13 +02:00
Andras Bacsai
5b1ac432c7
Improve S3 storage handling (#10832) 2026-07-02 15:07:00 +02:00
Andras Bacsai
20b5b90cf9 Merge remote-tracking branch 'origin/next' into improve-s3-storage-handling 2026-07-02 15:06:11 +02:00
Andras Bacsai
78d9244caa fix: improve s3 storage handling 2026-07-02 15:05:05 +02:00
Andras Bacsai
bed058b826
Improve outbound URL validation (#10833) 2026-07-02 15:02:37 +02:00
Andras Bacsai
558520ce75
Improve storage mount path handling (#10831) 2026-07-02 15:01:33 +02:00
Andras Bacsai
a06c1a7bf5 Improve storage mount path handling 2026-07-02 14:54:38 +02:00
Andras Bacsai
c7f014017b Improve outbound URL validation 2026-07-02 14:46:46 +02:00
Andras Bacsai
39ae16de42
Improve team resource route handling (#10829) 2026-07-02 14:34:27 +02:00
Andras Bacsai
a121386ab4 Merge branch 'next' into improve-resource-route-handling 2026-07-02 13:25:47 +02:00
Andras Bacsai
fb2d477e48 fix: improve team resource route handling 2026-07-02 13:05:27 +02:00
Andras Bacsai
74f4d04f53 fix(backups): default S3 storage for backup schedules
Show the S3 storage selector even when S3 backups are disabled, save
storage changes immediately, and improve responsive confirmation buttons.
2026-07-02 12:47:54 +02:00
Andras Bacsai
76d429fb74 fix(sidebar): center unread badge in settings menu 2026-07-02 12:35:28 +02:00
Julien Bouquillon
77086e28af
Merge branch 'v4.x' into api-application-preview-deployments 2026-07-01 19:11:16 +02:00
Andras Bacsai
22b31f5671 fix(backups): require valid S3 storage selection
Preserve S3 backups when a single valid storage is available, require
explicit selection when multiple storages exist, and disable S3 when none
are available.

Make backup action controls responsive on narrow screens.
2026-07-01 11:14:20 +02:00
Andras Bacsai
b93a91cc00 docs(security): document deployment command trust boundary 2026-06-30 15:48:22 +02:00
Andras Bacsai
78374b566a fix members smtp pw update 2026-06-30 15:29:19 +02:00
Andras Bacsai
63d6d835a9
Align resource creation permissions (#10799) 2026-06-29 15:59:46 +02:00
Andras Bacsai
29445bf177 fix: align resource creation permissions 2026-06-29 15:57:17 +02:00
Andras Bacsai
f2d11d9300
fix(railpack): interpolate build-time env variables by sourcing build… (#10768) 2026-06-29 11:08:19 +02:00
Andras Bacsai
9f36a8df31
Harden database backup imports (#10796) 2026-06-29 10:36:31 +02:00
Andras Bacsai
7d65a4b496 Merge remote-tracking branch 'origin/next' into harden-database-import-files 2026-06-29 10:35:35 +02:00
Andras Bacsai
f4c863bc34
fix(service): correct Convex origin env vars and expose HTTP actions port (#10646) 2026-06-29 10:27:55 +02:00
Andras Bacsai
0194a6f104
feat(service): add Inngest one-click service template (#10612) 2026-06-29 10:27:37 +02:00
Andras Bacsai
84bf96ce76
chore(service): gitea-runner patch version bump (#10566) 2026-06-29 10:27:20 +02:00
Andras Bacsai
2d63d51237 fix: harden database backup imports 2026-06-29 10:27:01 +02:00
Andras Bacsai
9a64b2ea0a Merge remote-tracking branch 'origin/next' into fix/railpack-buildtime-env-interpolation 2026-06-29 10:20:07 +02:00
Andras Bacsai
2dc34f61ff fix(railpack): create empty build-time env file 2026-06-29 10:19:22 +02:00
Andras Bacsai
fe9b43be7c
fix(deploy): preserve private key command metadata (#10795) 2026-06-29 10:17:57 +02:00
Andras Bacsai
a630532308 fix(deploy): preserve deploy key command metadata 2026-06-29 10:17:09 +02:00
Andras Bacsai
3729b5c074 improve github webhook 2026-06-28 15:25:58 +02:00
Andras Bacsai
1a5b8d3612 fix(deploy): skip logging deploy key commands 2026-06-28 13:15:18 +02:00
Andras Bacsai
dcb235f831
Validate environment variable keys (#10773) 2026-06-25 18:34:59 +02:00
Andras Bacsai
87d4744390 Validate environment variable keys 2026-06-25 18:19:58 +02:00
Andras Bacsai
bef94a9ce2 feat(mcp): add per-team server toggle 2026-06-25 11:42:19 +02:00
Aditya Tripathi
623bf89543
fix(railpack): interpolate build-time env variables by sourcing build-time .env
Railpack builds forwarded build-time variables inline as `env 'KEY=VALUE'`,
which single-quotes each value and prevents shell interpolation. References
like BETTER_AUTH_URL=$COOLIFY_URL reached the build as the literal string
"$COOLIFY_URL" instead of the resolved URL, breaking builds that validate
their env (e.g. SvelteKit/better-auth).

Wrap the railpack `docker buildx build` invocation with the same
wrap_build_command_with_env_export() helper used by the Dockerfile and
Nixpacks build paths, sourcing the build-time .env file (which writes
COOLIFY_* first and double-quotes normal vars to allow $VAR expansion).
Only buildpack control variables (NIXPACKS_/RAILPACK_), excluded from that
file and never needing interpolation, remain inline. Secret flags are
unchanged and read the interpolated values from the exported environment.

Fixes #10736
2026-06-24 20:11:46 +00:00
Andras Bacsai
3f0a0f7a0d
chore(ci): gate docs reminder comments on "Waiting for Docs PR" label (#10659) 2026-06-23 17:24:09 +02:00
Andras Bacsai
f87cacc3f0
chore(deps): bump esbuild, laravel-vite-plugin and vite (#10665) 2026-06-23 17:23:25 +02:00
Andras Bacsai
75791339d0
chore(deps): bump symfony/routing from 7.4.12 to 7.4.13 (#10680) 2026-06-23 17:23:00 +02:00
Andras Bacsai
f9b16b4158
chore(deps): bump symfony/http-foundation from 7.4.8 to 7.4.13 (#10683) 2026-06-23 17:22:40 +02:00
Andras Bacsai
9b6a9c6007
chore(deps): bump phpseclib/phpseclib from 3.0.52 to 3.0.54 (#10710) 2026-06-23 17:22:16 +02:00
Andras Bacsai
fd9293887e
chore(deps): bump laravel/framework from 12.60.2 to 12.61.1 (#10711) 2026-06-23 17:21:52 +02:00
Andras Bacsai
ae817a53fa
chore(deps): bump guzzlehttp/guzzle from 7.10.3 to 7.12.1 (#10738) 2026-06-23 17:21:27 +02:00
Andras Bacsai
376d9ae86b
chore(deps): bump guzzlehttp/psr7 from 2.10.1 to 2.12.1 (#10739) 2026-06-23 17:21:06 +02:00
dependabot[bot]
b3d4446d44
chore(deps): bump guzzlehttp/psr7 from 2.10.1 to 2.12.1
Bumps [guzzlehttp/psr7](https://github.com/guzzle/psr7) from 2.10.1 to 2.12.1.
- [Release notes](https://github.com/guzzle/psr7/releases)
- [Changelog](https://github.com/guzzle/psr7/blob/2.12/CHANGELOG.md)
- [Commits](https://github.com/guzzle/psr7/compare/2.10.1...2.12.1)

---
updated-dependencies:
- dependency-name: guzzlehttp/psr7
  dependency-version: 2.12.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-22 17:48:00 +00:00
dependabot[bot]
f3458e8943
chore(deps): bump guzzlehttp/guzzle from 7.10.3 to 7.12.1
Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 7.10.3 to 7.12.1.
- [Release notes](https://github.com/guzzle/guzzle/releases)
- [Changelog](https://github.com/guzzle/guzzle/blob/7.12/CHANGELOG.md)
- [Commits](https://github.com/guzzle/guzzle/compare/7.10.3...7.12.1)

---
updated-dependencies:
- dependency-name: guzzlehttp/guzzle
  dependency-version: 7.12.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-22 17:20:13 +00:00
dependabot[bot]
7f7f33b06d
chore(deps): bump laravel/framework from 12.60.2 to 12.61.1
Bumps [laravel/framework](https://github.com/laravel/framework) from 12.60.2 to 12.61.1.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/13.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/framework/compare/v12.60.2...v12.61.1)

---
updated-dependencies:
- dependency-name: laravel/framework
  dependency-version: 12.61.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-20 05:29:35 +00:00
dependabot[bot]
3c3e11b841
chore(deps): bump phpseclib/phpseclib from 3.0.52 to 3.0.54
Bumps [phpseclib/phpseclib](https://github.com/phpseclib/phpseclib) from 3.0.52 to 3.0.54.
- [Release notes](https://github.com/phpseclib/phpseclib/releases)
- [Changelog](https://github.com/phpseclib/phpseclib/blob/master/CHANGELOG.md)
- [Commits](https://github.com/phpseclib/phpseclib/compare/3.0.52...3.0.54)

---
updated-dependencies:
- dependency-name: phpseclib/phpseclib
  dependency-version: 3.0.54
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-20 04:01:07 +00:00
Andras Bacsai
00c5a630cf fix(subscription): clamp dynamic quantity to MIN_SERVER_LIMIT on update 2026-06-19 08:27:41 +02:00
dependabot[bot]
c886fdfe69
chore(deps): bump symfony/http-foundation from 7.4.8 to 7.4.13
Bumps [symfony/http-foundation](https://github.com/symfony/http-foundation) from 7.4.8 to 7.4.13.
- [Release notes](https://github.com/symfony/http-foundation/releases)
- [Changelog](https://github.com/symfony/http-foundation/blob/8.2/CHANGELOG.md)
- [Commits](https://github.com/symfony/http-foundation/compare/v7.4.8...v7.4.13)

---
updated-dependencies:
- dependency-name: symfony/http-foundation
  dependency-version: 7.4.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-16 08:03:53 +00:00
dependabot[bot]
6b1c86cb3a
chore(deps): bump symfony/routing from 7.4.12 to 7.4.13
Bumps [symfony/routing](https://github.com/symfony/routing) from 7.4.12 to 7.4.13.
- [Release notes](https://github.com/symfony/routing/releases)
- [Changelog](https://github.com/symfony/routing/blob/8.2/CHANGELOG.md)
- [Commits](https://github.com/symfony/routing/compare/v7.4.12...v7.4.13)

---
updated-dependencies:
- dependency-name: symfony/routing
  dependency-version: 7.4.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-16 04:38:36 +00:00
Andras Bacsai
9e021c4037 fix(api): enforce destination access and cleanup networks
Require admin team membership for destination mutations, return invalid-token
responses for tokenless requests, and remove standalone Docker networks when
deleting destinations.
2026-06-15 17:15:56 +02:00
Andras Bacsai
9665aa292c fix(api): block invalid destination types and service deletions 2026-06-15 17:03:01 +02:00
Andras Bacsai
506643603c Merge remote-tracking branch 'origin/next' into feat/api-destinations 2026-06-15 17:02:24 +02:00
Andras Bacsai
02ab4b39ef docs: replace CLAUDE.md with AGENTS.md symlink 2026-06-15 16:57:52 +02:00
Andras Bacsai
f5ecdfa4ce Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-06-15 13:29:25 +02:00
Andras Bacsai
96ea892748 fix(sidebar): remove theme switcher from sidebar navbar 2026-06-15 13:25:31 +02:00
Andras Bacsai
58af19b378
fix(auth): enforce policies across API and Livewire (#8628) 2026-06-15 13:18:29 +02:00
Andras Bacsai
dfd4d7e802 feat(resource-details): make copy fields visible and accessible 2026-06-15 13:17:53 +02:00
Andras Bacsai
371eb1e38c fix(upgrade): hide upgrade labels in collapsed sidebar 2026-06-15 12:56:19 +02:00
Andras Bacsai
22d05c78aa Merge remote-tracking branch 'origin/next' into ghe-support-helpers 2026-06-15 12:55:34 +02:00
Andras Bacsai
507a8afa20 fix(github): sync app slug before generating installation path 2026-06-15 12:55:29 +02:00
Andras Bacsai
b9bda7301a Merge remote-tracking branch 'origin/next' into fix-ghe-app-install-url 2026-06-15 12:55:08 +02:00
Andras Bacsai
d2deaa8363 fix(auth): restrict Sentinel access and register S3 policy 2026-06-15 12:31:30 +02:00
Andras Bacsai
2ebe2e8dbb Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-06-15 12:30:15 +02:00
Andras Bacsai
46a9578d69 test: align mobile application actions expectations 2026-06-15 12:06:54 +02:00
Andras Bacsai
78d8afa602 Merge remote-tracking branch 'origin/next' into audit-policies 2026-06-15 12:05:19 +02:00
Andras Bacsai
9302a49bbf Merge remote-tracking branch 'origin/next' into 10633-invitation-link-redirect 2026-06-15 11:58:03 +02:00
Andras Bacsai
45d9426690 test(auth): expect invitation link to use auth.link route 2026-06-15 11:55:03 +02:00
dependabot[bot]
85af9d7120
chore(deps): bump esbuild, laravel-vite-plugin and vite
Removes [esbuild](https://github.com/evanw/esbuild). It's no longer used after updating ancestor dependencies [esbuild](https://github.com/evanw/esbuild), [laravel-vite-plugin](https://github.com/laravel/vite-plugin) and [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). These dependencies need to be updated together.


Removes `esbuild`

Updates `laravel-vite-plugin` from 2.0.1 to 3.1.0
- [Release notes](https://github.com/laravel/vite-plugin/releases)
- [Changelog](https://github.com/laravel/vite-plugin/blob/3.x/CHANGELOG.md)
- [Upgrade guide](https://github.com/laravel/vite-plugin/blob/3.x/UPGRADE.md)
- [Commits](https://github.com/laravel/vite-plugin/compare/v2.0.1...v3.1.0)

Updates `vite` from 7.3.2 to 8.0.16
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.0.16/packages/vite)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version:
  dependency-type: indirect
- dependency-name: laravel-vite-plugin
  dependency-version: 3.1.0
  dependency-type: direct:development
- dependency-name: vite
  dependency-version: 8.0.16
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-14 11:55:25 +00:00
Osamaali313
74b1077010 fix: accept underscores in domain hostnames for API URL validation
PHP's FILTER_VALIDATE_URL rejects underscores in the host, so domains
like https://myapp_service.example.com were rejected by the API and
never got a Let's Encrypt certificate. Add an isValidDomainUrl() helper
that validates a copy with underscores replaced by hyphens, and route
domain validation in the Applications and Services API controllers
through it.

Fixes #10597
2026-06-13 22:46:04 +03:00
ShadowArcanist
7717860109
chore(ci): gate docs reminder comments on "Waiting for Docs PR" label 2026-06-13 20:52:22 +05:30
ShadowArcanist
62d9e40186
fix(repo): remove bounty and beta referrences on contributors guidelines 2026-06-13 20:24:44 +05:30
ShadowArcanist
7b5415fdbe
fix(repo): remove beta from placeholder values on issue template 2026-06-13 20:15:25 +05:30
ShadowArcanist
46bfa3e4c5
Merge branch 'next' into shadow/improve-contributor-mds 2026-06-13 20:12:26 +05:30
Andras Bacsai
52739141ee
fix(previews): clean up closed PR previews after update failures (#10180) 2026-06-12 20:08:34 +02:00
Andras Bacsai
403f8abcb4 Merge remote-tracking branch 'origin/next' into fix-ghe-app-install-url 2026-06-12 20:02:23 +02:00
Andras Bacsai
78d7291929 fix(github): keep provided api_url on GitHub app updates 2026-06-12 19:56:13 +02:00
Andras Bacsai
4f509c02be fix(auth): validate invitation magic link tokens
Accept invitation links across configured public origins while still
rejecting stored invitations whose token no longer matches.
2026-06-12 16:17:45 +02:00
Andras Bacsai
442ed98169 feat(project): add mobile action controls for resources
Show restart, stop, redeploy, and update actions directly in the mobile
headers for applications, databases, and services, with coverage for the
mobile resource menu behavior.
2026-06-12 16:09:26 +02:00
Andras Bacsai
1aca7ead8c fix(logs): constrain activity monitor output width 2026-06-12 16:06:20 +02:00
Andras Bacsai
03d2fabc64 chore(release): bump Coolify to 4.2.0 2026-06-12 16:05:41 +02:00
Andras Bacsai
61d2d17f52 feat(subscription): add Stripe action controls
Add subscription action handling and tests for cancel, resume, and refund flows while resolving StripeClient through the container.
2026-06-12 15:54:21 +02:00
Torsten O'Donoghue
1e5e4ae61e fix(service): correct Convex origin env vars and expose HTTP actions port 2026-06-12 10:45:52 +02:00
Andras Bacsai
1833ba7ce6 chore(boost): enable cloud config and agent skills 2026-06-11 11:59:08 +02:00
Andras Bacsai
8aea029782 chore(skills): add Nightwatch and MCP agent skills
Add Nightwatch configuration guidance and MCP development skill docs across agent integrations, and refresh existing Laravel skill references.
2026-06-11 11:58:42 +02:00
Rohit Tiwari
005f12442d
fix(template): removed volume, changed inggest url variable and limited to version inngest/inngest:v1.27.0 2026-06-10 13:46:21 +05:30
Rohit Tiwari
9196d8ed0a
fix(template): magic variable used on inngest changed to hex magic variable 2026-06-10 08:57:12 +05:30
Andras Bacsai
018d267b3f
fix(service): limit Grafana extra fields to Grafana images (#10562) 2026-06-09 22:16:52 +02:00
Rohit Tiwari
4d9ce2da6b
add(service): inngest one click service template 2026-06-09 23:25:41 +05:30
Andras Bacsai
ee74889f19 feat(resources): show mobile action buttons 2026-06-09 18:45:06 +02:00
Andras Bacsai
0d9a39ea23 fix(github): sync pending app credentials before slug lookup 2026-06-09 18:32:05 +02:00
Andras Bacsai
281184c040 fix(github): derive app API URLs from HTML hosts
Normalize GitHub organization values and derive API URLs for GitHub.com,
GHE.com, and enterprise hosts when creating or updating GitHub Apps.
2026-06-09 18:31:06 +02:00
Andras Bacsai
bc2c6068ea fix(github): sync app slug before building install URL
Move GitHub App JWT generation and slug synchronization into shared helpers so installation URLs use the canonical GitHub slug. Encode GHE organization path segments and keep the app-scoped fallback for blank organizations.
2026-06-09 15:27:35 +02:00
Andras Bacsai
96adf9b0f4 Merge remote-tracking branch 'origin/next' into fix-ghe-app-install-url 2026-06-09 15:26:44 +02:00
Cornelis Terblanche
3f46710309 Refine cloud provider token form 2026-06-08 18:38:08 +02:00
vuguul
5e37024f10 fix(git): use cloud install path for ghe apps 2026-06-06 17:23:22 -06:00
Michalzarddev
cfd31327bb
Merge branch 'v4.x' into chore/gitea-runner-version-bump 2026-06-06 00:13:20 +02:00
michalzard
e5043f7cc2 chore(gitea-runner): patch version bump 2026-06-06 00:11:24 +02:00
vuguul
4c77504b5e fix(service): limit Grafana extra fields to Grafana images 2026-06-05 14:29:29 -06:00
Andras Bacsai
a9d9bfdbe3 feat(resources): add responsive mobile navigation menus
Unify application, database, and service headings with mobile-friendly
resource menus, route-aware configuration tabs, and confirmation triggers for
advanced actions. Standardize restart warnings with status badges and cover the
responsive menu and badge rendering behavior with feature tests.
2026-06-05 14:57:57 +02:00
Andras Bacsai
51583069f4 feat(status): unify resource status badges
Introduce a shared status badge component and reuse it across resource status views, service cards, and the server navbar. Replace icon-only refresh controls with consistent badge buttons and cover the new status layout with feature tests.
2026-06-05 13:31:20 +02:00
vaguul
63ba33261b fix(api): allow source commit build setting 2026-06-04 17:51:17 -06:00
Andras Bacsai
70eda65d19 fix(api): hide nested server secrets from read tokens
Require read:sensitive for nested server logdrain and sentinel fields in
application and database API responses.

Limit deployment configuration column migration SQL to PostgreSQL.
2026-06-04 16:51:52 +02:00
Andras Bacsai
7053f560c5 chore(navbar): replace theme selector with cycle button 2026-06-04 15:41:38 +02:00
Andras Bacsai
2fcc42b0a9 Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-06-04 15:27:32 +02:00
Andras Bacsai
22f9f96db6 chore: inspect staged changes for commit message 2026-06-04 15:24:53 +02:00
Andras Bacsai
8a2373e49f fix(ui): standardize permission denial callouts 2026-06-04 11:37:16 +02:00
Andras Bacsai
5973bb4d4f fix(security): hide notification secrets from non-admins
Prevent users without update permission from reading notification credentials and manual webhook secrets in Livewire state or rendered forms.
2026-06-04 11:24:19 +02:00
Andras Bacsai
062ad57740 fix(security): enforce team access on mutable actions
Authorize cloud provider token access, audit sensitive operations, and
standardize public IDs across deployment and resource flows.
2026-06-04 11:03:06 +02:00
Andras Bacsai
b01c2dd52b Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-06-04 10:58:07 +02:00
Andras Bacsai
9dca7ca351 Merge remote-tracking branch 'origin/next' into audit-policies 2026-06-04 10:18:54 +02:00
Cornelis Terblanche
f7150a1d6c Fix Vultr power controls for stopped instances 2026-06-03 21:32:18 +02:00
Cornelis Terblanche
94abbe1590 Add Vultr cloud provider integration 2026-06-03 21:32:18 +02:00
Andras Bacsai
81cff9f486 Merge remote-tracking branch 'origin/next' into feat/api-destinations 2026-06-03 13:57:04 +02:00
Andras Bacsai
252a4a702c Merge remote-tracking branch 'origin/next' into audit-policies 2026-06-02 12:08:35 +02:00
Andras Bacsai
973632b49c Merge remote-tracking branch 'origin/next' into audit-policies 2026-06-02 12:03:38 +02:00
Andras Bacsai
0038a8f5c9 Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-06-02 11:57:13 +02:00
Julien Bouquillon
a0d3da372e
Merge branch 'v4.x' into api-application-preview-deployments 2026-05-28 10:26:02 +02:00
Poul
68e9184b57 fix(api/destinations): use whereHas instead of ownedByCurrentTeamAPI for back-compat
The ownedByCurrentTeamAPI scope was added to StandaloneDocker/SwarmDocker
*after* 4.0.0-beta.470 — running containers on that beta hit a
BadMethodCallException. Rewrites all team scoping to use
whereHas('server', whereTeamId) which works against any v4.x of
Coolify (StandaloneDocker.server_id -> Server.team_id has been there
since the multi-team change).

Also guards attachedTo() with method_exists and falls back to a manual
attached-resource check covering applications + every standalone DB
relation, so delete() doesn't crash on older versions either.
2026-05-25 11:47:10 +00:00
Poul
789e2c5cab fix(api/destinations): use getTeamIdFromToken() like other Api controllers
Initial draft called auth()->user()->currentTeam() which returns null in
the API context (Sanctum tokens don't carry the per-user currentTeam
state — that's a session/Livewire concept). Other Api controllers
(ServersController, ScheduledTasksController, etc.) use the canonical
helper getTeamIdFromToken() with a null guard returning 403.

This swap makes all five endpoints work against a real token.
2026-05-25 11:36:26 +00:00
Poul
fe855cf8d0 feat(api): add REST endpoints for destinations
The Destinations section is exposed in the Coolify UI but not via the
REST API. The destination_uuid field is required when creating
applications via create-public-application, but no way to enumerate or
create destinations programmatically existed — this blocks IaC tools
(e.g. an Aspire publisher targeting Coolify).

Adds, scoped to the existing v1 auth:sanctum + ApiAllowed + api.sensitive
group:

  GET    /api/v1/destinations
  GET    /api/v1/destinations/{uuid}
  DELETE /api/v1/destinations/{uuid}
  GET    /api/v1/servers/{server_uuid}/destinations
  POST   /api/v1/servers/{server_uuid}/destinations

The controller uses the existing inline-Validator convention (no Form
Request classes per the API surface's house style), reuses
StandaloneDocker::ownedByCurrentTeamAPI / SwarmDocker::ownedByCurrentTeamAPI
for team scoping (matching ScheduledTasksController etc.), and respects
the `attachedTo()` guard on delete.

No migrations needed — both standalone_dockers and swarm_dockers tables
already carry uuid/name/network/server_id/timestamps.

OpenAPI @OA\ annotations omitted in this commit to keep the diff
minimal; a follow-up can add them in the style of ServersController.
2026-05-25 11:15:08 +00:00
seahurt
d3b76dfa93
fix: only strip git_host from repository_url when git_host is github.com 2026-05-19 14:10:17 +08:00
Julien Bouquillon
89d7672253 feat(api): add is_preview_deployments_enabled on applications 2026-05-13 13:09:18 +02:00
Andras Bacsai
fb13a6cdc0 fix(api): expose cloud tokens with sensitive read access
Show cloud provider token values only when the API request has sensitive
read permission, and cover read, read:sensitive, and root token behavior.
2026-05-13 11:29:48 +02:00
Andras Bacsai
6ab88c46b2 Merge remote-tracking branch 'origin/next' into audit-policies 2026-05-13 11:15:29 +02:00
Andras Bacsai
d8972e97c9 fix(previews): clean up closed PR previews after update failures
Catch and report failures while updating closed pull request status so preview deployment cleanup still runs for closed GitHub pull request webhooks.

Add coverage for cleanup continuing when GitHub comment cleanup fails.
2026-05-13 09:31:28 +02:00
Andras Bacsai
db23ee76fd Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-05-11 21:45:07 +02:00
Andras Bacsai
81a3bb0f07 fix(api): hide sensitive fields by default
Add model-level hidden fields for secrets, tokens, keys, notification
credentials, deployment logs, and environment values. Allow explicit
read:sensitive API access to reveal gated private keys and deployment logs,
and cover the behavior with feature and unit tests.
2026-05-11 21:18:07 +02:00
Andras Bacsai
c175d3d282 Merge remote-tracking branch 'origin/next' into audit-policies 2026-05-11 21:13:57 +02:00
Andras Bacsai
f40bb80f9d style(api): tighten nested server secret visibility checks 2026-05-11 20:52:29 +02:00
Andras Bacsai
b29bdce73a Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-05-11 17:34:48 +02:00
Andras Bacsai
12aba41d9a fix(api): gate service server secrets by sensitive scope
Only eager load nested server settings for service responses when the API token has read:sensitive, preventing read-only tokens from exposing sentinel fields while preserving sensitive access.
2026-05-11 11:53:22 +02:00
Andras Bacsai
c97f916052 fix(api): hide application compose PR fields
Add compose PR fields to the Application hidden attributes and allow database list queries to eager load nested server settings when sensitive access is permitted.
2026-05-11 11:46:05 +02:00
Andras Bacsai
ffa494d391 Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-05-11 11:36:24 +02:00
Andras Bacsai
224b9e4397 Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-05-07 16:36:58 +02:00
Andras Bacsai
c553b6aef9 Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-05-06 14:33:19 +02:00
Andras Bacsai
0888198a81 Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-05-05 22:09:34 +02:00
Andras Bacsai
5f124ae8ec Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-05-05 22:04:49 +02:00
Josh Salway
3b763d54cc test(deploy): remove coercion test to keep PR focused on the fix 2026-05-03 00:03:14 +10:00
Josh Salway
6eb527d0ab test(deploy): expand force param tests to cover all coercion cases
Adds datasets for falsy (false, 0) and truthy (true, 1) query string
values, covering the full coercion table from the PR description.
2026-05-02 23:37:57 +10:00
Josh Salway
7c3723d207 test(deploy): assert force=false query param does not set force_rebuild
Regression test for PHP string truthy coercion bug:
- force=false as query string should not trigger --no-cache
- force=true as query string should trigger --no-cache
- missing force param defaults to false
2026-05-02 23:26:22 +10:00
Josh Salway
08a12c392a fix(deploy): cast force param as boolean to prevent cache bust on every deploy
$request->input('force') ?? false reads "false" as a non-empty string,
which PHP coerces to true. Replace with $request->boolean() which uses
filter_var(FILTER_VALIDATE_BOOLEAN), correctly mapping "false" -> false.
2026-05-02 23:11:22 +10:00
Andras Bacsai
ea0ade442b Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-04-30 16:45:34 +02:00
Andras Bacsai
8dc79f4ed6 fix(api): expose nested server secrets for privileged tokens
Add `exposeNestedServerSecrets()` to Applications, Databases, and
Services controllers so that `read:sensitive`/`root` tokens see
sentinel and logdrain fields on eager-loaded Server + ServerSetting
relations.

ServicesController handles both single models and Eloquent Collections
(listing endpoint passes a Collection per project).

Tests tightened to use JSON-key assertions (`"field":`) to avoid false
positives from field names appearing in values.
2026-04-30 11:49:15 +02:00
Andras Bacsai
e828058755 Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-04-30 11:30:50 +02:00
Andras Bacsai
8b7dbbafb2 fix(api): hide sensitive fields by default, expose via makeVisible for privileged tokens
Models now declare $hidden for passwords, tokens, db URLs, and compose
fields. API controllers flip from makeHidden-on-deny to makeVisible-on-
allow (can_read_sensitive=true), fixing fields that were never hidden.
Also adds missing fields (mysql/mariadb passwords, logdrain keys, etc.)
to privileged disclosure lists.

Tests added: Feature/Security/ApiSensitiveFieldsTest and
Unit/Models/SensitiveFieldsHiddenTest cover all affected models and
controllers.
2026-04-30 11:28:06 +02:00
Jan Thiel
6637159d7b feat(hetzner): add support for enabling backups during server creation 2026-04-28 15:37:26 +02:00
Andras Bacsai
6a5fd40a5c refactor(policies): add uploadBackup ability and enforce it on backup upload endpoint
Introduce a dedicated `uploadBackup` ability on Application, Database,
Service, and ServiceDatabase policies (admin/owner only) and call
`$this->authorize('uploadBackup', $resource)` in `UploadController::upload`
so the backup-upload endpoint goes through the same policy layer as the
rest of the authorization refactor. Adds Pest coverage for each policy
variant plus HTTP-level checks.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 11:51:35 +02:00
Andras Bacsai
8a715489cb Delete lessons.md 2026-04-19 17:42:17 +02:00
Andras Bacsai
1f9dd5326f Merge remote-tracking branch 'origin/next' into audit-policies
# Conflicts:
#	tests/Feature/DatabaseBackupCreationApiTest.php
2026-04-19 17:40:12 +02:00
Andras Bacsai
43f33d94ad Merge remote-tracking branch 'origin/next' into audit-policies
# Conflicts:
#	app/Http/Controllers/Api/SecurityController.php
#	app/Http/Controllers/Api/ServersController.php
#	app/Livewire/Admin/Index.php
#	app/Livewire/Destination/Show.php
#	app/Livewire/NavbarDeleteTeam.php
#	app/Livewire/Project/Application/Previews.php
#	app/Livewire/Project/DeleteProject.php
#	app/Livewire/Project/Shared/ResourceOperations.php
#	app/Livewire/Server/Resources.php
#	app/Livewire/Server/ValidateAndInstall.php
#	app/Livewire/Storage/Show.php
#	resources/views/livewire/dashboard.blade.php
#	resources/views/livewire/project/application/heading.blade.php
#	resources/views/livewire/project/database/heading.blade.php
#	resources/views/livewire/project/service/heading.blade.php
#	resources/views/livewire/project/shared/environment-variable/show.blade.php
#	resources/views/livewire/project/shared/scheduled-task/show.blade.php
#	tests/Feature/Security/TrustHostsMiddlewareTest.php
2026-04-19 15:19:37 +02:00
Jan Thiel
a4b27641c8 feat(hetzner): add endpoints and UI for attaching firewalls and internal networks to the Server Creation dialog 2026-04-19 06:12:50 +02:00
Tobias Thiele
8b12aae266 fix(parsers): remove unused $svc variable in dockercompose domain loop
Use array_keys() instead of key-value iteration since only the service
name keys are needed for comparison. Addresses CodeRabbit review feedback.
2026-04-02 09:25:59 +02:00
Bakr Elsherif
2af16cd25e
Merge branch 'next' into next 2026-03-31 00:38:18 +03:00
Bakr
a77e91eca4 fix(api): return array from removeSensitiveData for service applications list 2026-03-30 22:14:34 +03:00
Tobias Thiele
7f46b2ed71 Populate docker_compose_domains for dockercompose apps
Add logic to populate docker_compose_domains in applicationParser
for dockercompose build packs, ensuring proper domain handling
for KEY-based SERVICE_FQDN variables.
2026-03-30 14:59:20 +02:00
Michael Jathe
5ea1ee6948
Merge branch 'next' into feat/api/tag-management 2026-03-30 11:51:41 +02:00
Michael Jathe
2b573ef5ec
Merge branch 'next' into feat/api/tag-management 2026-03-30 10:04:00 +02:00
Michael Jathe
23d5b854e9 feat(api): add tag management endpoints for applications, databases, and services
Add CRUD tag endpoints (GET/POST/DELETE) as sub-resources for applications,
databases, and services. Add team-level GET /tags endpoint. Extend all
resource creation endpoints to accept an optional tags array.

Uses a shared HandlesTagsApi trait to avoid duplication across controllers.
Tags are race-safe via syncWithoutDetaching(), garbage-collected when orphaned,
and sanitized (strip_tags + lowercase).
2026-03-29 16:02:05 +02:00
Bakr
8ad65a0ef8 eat(api): add service-applications API to manage service applications 2026-03-29 06:03:47 +03:00
Niklas Wichter
2f8df2f9bd fix(test): align test setup with project conventions 2026-03-13 17:25:00 +01:00
Niklas Wichter
94700347f8 test: add move resource API tests 2026-03-13 17:05:00 +01:00
Niklas Wichter
6b9a755e32 feat(api): add POST /move endpoints for applications, databases, and services 2026-03-13 16:32:00 +01:00
Niklas Wichter
d8178df838 feat(api): add shared helper for moving resources between environments 2026-03-13 15:48:00 +01:00
Niklas Wichter
63008fceb3 feat(api): add ownedByCurrentTeamAPI scope to Environment model 2026-03-13 15:15:00 +01:00
Andras Bacsai
9b94ae1c1a Merge remote-tracking branch 'origin/next' into audit-policies 2026-03-10 10:52:39 +01:00
Andras Bacsai
f83c71fd4f Merge remote-tracking branch 'origin/next' into audit-policies 2026-03-06 08:04:10 +01:00
Andras Bacsai
84a52006f4 Merge remote-tracking branch 'origin/next' into audit-policies 2026-03-04 11:39:21 +01:00
Andras Bacsai
4fa048f931 Merge remote-tracking branch 'origin/next' into audit-policies 2026-03-03 19:41:05 +01:00
Andras Bacsai
dbf4fab7ef Merge remote-tracking branch 'origin/next' into audit-policies 2026-03-02 13:24:14 +01:00
Andras Bacsai
7154febf32 Merge remote-tracking branch 'origin/next' into audit-policies 2026-03-02 12:41:30 +01:00
Andras Bacsai
b38ce26e34 fix(auth): preserve Sanctum token prefix for lookups
Sanctum uses the numeric prefix (e.g. "69|...") in plaintext tokens
to index and look up tokens. Stripping this prefix breaks token
resolution.
2026-03-01 14:08:29 +01:00
Andras Bacsai
ad433a0798 Merge remote-tracking branch 'origin/next' into audit-policies 2026-03-01 13:03:51 +01:00
Andras Bacsai
b2f09f4df0 fix(auth): resolve current team from Sanctum token for API requests
Add fallback to resolve team from Sanctum access token when session team
is unavailable, enabling proper team context for stateless API requests.
2026-02-27 23:11:03 +01:00
Andras Bacsai
66dc1515d4 fix(security): prevent snapshot replay in API token permission checks
Never trust Livewire component properties for authorization decisions, as
snapshots can be replayed from another user's session. Re-evaluate all
permission checks fresh using auth()->user()->can() against current policies
to ensure the authenticated user is being authorized, not a replayed copy.

- Replace cached canUse* booleans with fresh policy evaluation
- Add comprehensive security tests for token creation permissions
- Update API authorization tests to verify middleware blocking behavior
2026-02-27 22:58:44 +01:00
Andras Bacsai
c924655999 feat(auth): restrict sensitive data visibility for team members
Hide database passwords, connection URLs, and debug logs from team members:
- Database components: hide passwords and connection URLs for members
- Deployment UI: gate debug log toggle behind update permission
- Debug logs: prevent members from viewing debug output
- Storage/services: hide sensitive credentials from members

Members can still view non-sensitive configuration while admins retain full access to all data.
2026-02-27 22:42:48 +01:00
Andras Bacsai
0636789071 Merge remote-tracking branch 'origin/next' into audit-policies 2026-02-27 22:05:49 +01:00
Andras Bacsai
c1cc7920e1 chore: prepare for PR 2026-02-27 18:31:35 +01:00
Andras Bacsai
af903217f5
nothing to see here (#8652) 2026-02-27 12:03:31 +01:00
Andras Bacsai
68f81df0bb refactor(auth): enforce authorization checks across livewire components
Add authorization checks to multiple Livewire components to ensure users
have proper permissions before performing sensitive operations. This includes:

- Adding AuthorizesRequests trait to components handling deployments, backups,
  services, and configuration uploads
- Enforcing 'deploy', 'update', and 'manageBackups' authorization checks
- Adding instance admin check for system upgrade operations
- Improving database queries with team ownership scope
- Moving backup trigger from component to button with new backupNow() method
2026-02-27 11:59:26 +01:00
Andras Bacsai
cebef8e258 fix(policies): ensure instance-level databases use root team
Instance-level databases like coolify-db (with id = 0) should always
be assigned to the root team (id = 0) rather than attempting to resolve
their team from the database object itself.
2026-02-27 11:54:22 +01:00
Andras Bacsai
dbbc77830e fix(storage): add error handling for S3 connection error notifications
Wrap email notification logic in try-catch to prevent email sending failures from breaking the connection test. If notification fails, log a warning and continue instead of letting the exception propagate.
2026-02-27 11:48:48 +01:00
Andras Bacsai
b878dc8102 refactor(auth): enforce team member authorization across app
Restrict sensitive operations to admins/owners and hide sensitive data
from team members:
- Add authorization checks to Livewire components and API endpoints
- Restrict team members from accessing sensitive permissions and data
- Hide environment variable values from non-admin team members
- Update policies to enforce team-level admin status requirement
- Add useSensitivePermissions policy for read:sensitive tokens
- Improve disabled button UX with auth-specific tooltips
- Add authorization checks in middleware for API tokens

Closes authorization gaps in project management, server management,
and settings components.
2026-02-27 11:41:01 +01:00
Andras Bacsai
e82942b387 test: refresh api and job feature suites 2026-02-26 08:37:20 +01:00
Andras Bacsai
347af07a79 chore(tests): reorganize feature suites and expand team auth coverage 2026-02-26 07:13:19 +01:00
Andras Bacsai
34d8499a0c test(auth): cover authorization scenarios for api and ui 2026-02-26 06:55:08 +01:00
Andras Bacsai
52b88135f3 test(browser): improve "ResourceSettingsPersistence" assertions
Adjusted Discord notification setup, Livewire form submission handling, and checkbox interactions in `ResourceSettingsPersistenceTest` to better reflect page flows.
2026-02-25 22:35:37 +01:00
Andras Bacsai
9c1ca422ce test(browser): remove notification prompt helper 2026-02-25 19:28:39 +01:00
Andras Bacsai
37eac11df3 test(browser): cover resource settings persistence 2026-02-25 19:26:55 +01:00
Andras Bacsai
f09bbb4a04 Merge remote-tracking branch 'origin/next' into audit-policies
# Conflicts:
#	tests/Unit/Policies/GithubAppPolicyTest.php
#	tests/Unit/Policies/SharedEnvironmentVariablePolicyTest.php
2026-02-25 18:53:39 +01:00
Andras Bacsai
ede75283db test(browser): expand server/project auth coverage 2026-02-25 18:50:26 +01:00
Andras Bacsai
94dfd6a54e fix(auth): enforce authorization checks in Livewire components
- Replace manual ownership checks with authorize() in Destination/Show, NavbarDeleteTeam, and Project/Show
- Add authorization checks for team deletion and environment creation
- Add proper exception handling with try-catch blocks
- Add comprehensive feature and browser tests for authorization scenarios
- Update CLAUDE.md with Pest Browser Plugin testing guidelines
2026-02-25 16:38:04 +01:00
Andras Bacsai
41e1248b6f fix(auth): enforce proxy authorization checks in server navbar
Add authorization gate using @can('manageProxy') directive to ensure only
authorized users can view and interact with proxy control buttons (restart,
stop, start) in the server navbar component. Refactor tests to validate that
members cannot see proxy buttons while admins can.
2026-02-25 15:37:04 +01:00
Andras Bacsai
fcc58ca08a fix(auth): enforce dashboard authorization and improve team deletion
Add authorization gates to Project and Server creation buttons in the dashboard to prevent non-admin users from accessing resource creation. Improve team deletion to clear cache before deletion and automatically switch to the user's next available team.

- Hide create buttons from non-admin users in dashboard
- Clear cache before team deletion to prevent stale session resolution
- Switch user session to next available team when current team is deleted
- Handle refreshSession when user has no remaining teams
- Add tests for dashboard authorization enforcement and team deletion flow
2026-02-25 14:47:35 +01:00
Andras Bacsai
86b05b902a fix(auth): enforce authorization checks across API and Livewire components
- Add authorization checks to API controller endpoints (view, create, update, delete)
- Wrap Livewire component methods with try-catch for consistent error handling
- Add AuthorizesRequests trait to components requiring authorization checks
- Ensure all sensitive operations verify user permissions before execution
- Implement unified error handling with handleError() helper function
2026-02-25 14:20:29 +01:00
ShadowArcanist
2b04153dec chore(repo): improve enhancement bounty issue template 2026-02-24 00:50:46 +05:30
ShadowArcanist
84224d6366 chore(repo): improve bug report issue template 2026-02-24 00:49:45 +05:30
ShadowArcanist
4776a57231 chore(repo): improve development guide 2026-02-24 00:46:28 +05:30
ShadowArcanist
555b46a7d8 chore(repo): improve contributor guidelines 2026-02-24 00:45:33 +05:30
Yanluis Fermin
ea941da631
Merge branch 'next' into feat/database-service-logs-endpoint 2025-08-11 10:22:45 -04:00
Yanluis Fermin
ab25e6933e
Merge branch 'next' into feat/database-service-logs-endpoint 2025-08-04 08:37:40 -04:00
Yanluis Fermin
0eb2ea86e8
feat(api): add 'show_timestamps' parameter to logs endpoints 2025-07-30 21:32:11 -04:00
Yanluis Fermin
c239b8bbba
refactor(api): modify service sub container retrieval filter to use coolify.name 2025-07-30 13:55:02 -04:00
Yanluis Fermin
28e20473da
refactor(api): update service logs endpoint to use sub service name 2025-07-30 13:55:02 -04:00
Yanluis Fermin
bc9bfaefc7
feat(api): add endpoints to retrieve service logs by UUID for each container 2025-07-29 22:40:02 -04:00
Yanluis Fermin
5848b07fc2
feat(api): add endpoint to retrieve database logs by UUID 2025-07-29 21:42:47 -04:00
1062 changed files with 66651 additions and 11095 deletions

View file

@ -0,0 +1,404 @@
---
name: configure-nightwatch
description: Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies. Use when setting up Nightwatch, managing data volume, protecting sensitive data (PII), or optimizing event collection for production workloads.
license: MIT
metadata:
author: laravel
---
# Nightwatch Configuration Guide
This skill helps configure Laravel Nightwatch data collection to balance observability, performance, and privacy. Covers sampling strategies, filtering rules, and redaction methods across all event types.
## Documentation Reference
The [Nightwatch Documentation](https://nightwatch.laravel.com/docs) is the definitive and up-to-date source of information for all Nightwatch configuration options. This skill provides practical guidance and common patterns, but always consult the official documentation as the primary source of truth for specific details, environment variables, and API behavior. The documentation includes comprehensive coverage of:
- [Filtering and Configuration](https://nightwatch.laravel.com/docs/filtering) - Core concepts for sampling, filtering, and redaction
- Individual event type pages with specific configuration options:
- [Requests](https://nightwatch.laravel.com/docs/requests) - Request sampling, header handling, payload capture
- [Commands](https://nightwatch.laravel.com/docs/commands) - Command sampling and redaction
- [Queries](https://nightwatch.laravel.com/docs/queries) - Query filtering and redaction
- [Cache](https://nightwatch.laravel.com/docs/cache) - Cache event filtering by key or pattern
- [Jobs](https://nightwatch.laravel.com/docs/jobs) - Job filtering and sampling decoupling
- [Mail](https://nightwatch.laravel.com/docs/mail) - Mail event filtering
- [Notifications](https://nightwatch.laravel.com/docs/notifications) - Notification filtering by channel
- [Exceptions](https://nightwatch.laravel.com/docs/exceptions) - Exception sampling and throttling
- [Outgoing Requests](https://nightwatch.laravel.com/docs/outgoing-requests) - HTTP request filtering
- [reference.md](reference.md) - Quick lookup table by event type, production presets, and verification checklist
## Data Collection Flow
Nightwatch processes events through three stages:
1. **Sampling** - Controls which entry points are captured (requests, commands, scheduled tasks)
2. **Filtering** - Excludes specific events after sampling (queries, cache, mail, etc.)
3. **Redaction** - Modifies captured data to remove/obfuscate sensitive information
```
Request/Command/Scheduled Task
|
v
[Sampling?] ----NO----> Drop entire trace
| YES
v
Events generated
|
v
[Filtering?] ----YES---> Drop specific event
| NO
v
[Redaction] ----------> Store modified data
```
---
## Sampling Configuration
Sampling determines which entry points (requests, commands, scheduled tasks) trigger full trace collection. When an entry point is sampled, all related events are captured.
### Global Sample Rates
Configure via environment variables:
```bash
# Default: 100% sampling (all requests/commands captured)
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.1 # Recommended: 10% of requests
NIGHTWATCH_COMMAND_SAMPLE_RATE=1.0 # Capture all commands
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0 # Always capture exceptions
```
**Recommendation**: Start with `0.1` (10%) for requests in production, adjust based on volume and needs.
### Route-Based Sampling
Apply different rates to specific routes using the `Sample` middleware:
```php routes/web.php
use Illuminate\Support\Facades\Route;
use Laravel\Nightwatch\Http\Middleware\Sample;
// Sample admin routes at 100%
Route::middleware(Sample::rate(1.0))->prefix('admin')->group(function () {
// All admin routes sampled fully
});
// Sample API routes at 5%
Route::middleware(Sample::rate(0.05))->prefix('api')->group(function () {
// API routes sampled sparingly
});
// Always sample critical endpoints
Route::post('/checkout', [CheckoutController::class, 'process'])
->middleware(Sample::always());
// Never sample health checks
Route::get('/health', [HealthController::class, 'check'])
->middleware(Sample::never());
```
### Unmatched Route Sampling
Handle 404/bot traffic with reduced sampling:
```php routes/web.php
Route::fallback(fn () => abort(404))
->middleware(Sample::rate(0.01)); // 1% sampling for unmatched routes
```
### Dynamic Sampling
Sample based on runtime conditions (user role, request attributes):
```php app/Http/Middleware/SampleAdminRequests.php
use Closure;
use Illuminate\Http\Request;
use Laravel\Nightwatch\Facades\Nightwatch;
class SampleAdminRequests
{
public function handle(Request $request, Closure $next)
{
if ($request->user()?->isAdmin()) {
Nightwatch::sample(); // Always sample admin requests
}
return $next($request);
}
}
```
### Command Sampling
Exclude specific commands from sampling:
```php AppServiceProvider.php
use Illuminate\Console\Events\CommandStarting;
use Illuminate\Support\Facades\Event;
use Laravel\Nightwatch\Facades\Nightwatch;
public function boot(): void
{
Event::listen(function (CommandStarting $event) {
if (in_array($event->command, ['schedule:finish', 'horizon:snapshot'])) {
Nightwatch::dontSample();
}
});
}
```
### Vendor Commands
Nightwatch automatically ignores framework/internal commands. Opt-in to capture them:
```php
Nightwatch::captureDefaultVendorCommands();
```
---
## Filtering Configuration
Filtering excludes specific events from collection after sampling. Use filtering to reduce noise and quota usage.
### Database Queries
**Filter all queries** (disable query collection):
```bash
NIGHTWATCH_IGNORE_QUERIES=true
```
**Filter specific queries** by SQL pattern:
```php AppServiceProvider.php
use Laravel\Nightwatch\Facades\Nightwatch;
use Laravel\Nightwatch\Records\Query;
public function boot(): void
{
// Filter job table queries (PostgreSQL)
Nightwatch::rejectQueries(function (Query $query) {
return str_contains($query->sql, 'into "jobs"');
});
// Filter cache table queries (MySQL)
Nightwatch::rejectQueries(function (Query $query) {
return str_contains($query->sql, 'from `cache`')
|| str_contains($query->sql, 'into `cache`');
});
}
```
### Cache Events
**Filter all cache events**:
```bash
NIGHTWATCH_IGNORE_CACHE_EVENTS=true
```
**Filter by cache key patterns**:
```php
Nightwatch::rejectCacheKeys([
'my-app:users', // Exact match
'/^my-app:posts:/', // Regex: starts with my-app:posts:
'/^[a-zA-Z0-9]{40}$/', // Regex: session IDs
]);
```
**Filter with callback**:
```php
use Laravel\Nightwatch\Records\CacheEvent;
Nightwatch::rejectCacheEvents(function (CacheEvent $cacheEvent) {
return str_starts_with($cacheEvent->key, 'temp:');
});
```
### Mail Events
**Filter all mail**:
```bash
NIGHTWATCH_IGNORE_MAIL=true
```
**Filter specific mail**:
```php
use Laravel\Nightwatch\Records\Mail;
Nightwatch::rejectMail(function (Mail $mail) {
return str_contains($mail->subject, 'Newsletter');
});
```
### Notification Events
**Filter all notifications**:
```bash
NIGHTWATCH_IGNORE_NOTIFICATIONS=true
```
**Filter by channel**:
```php
use Laravel\Nightwatch\Records\Notification;
Nightwatch::rejectNotifications(function (Notification $notification) {
return $notification->channel === 'database';
});
```
### Outgoing HTTP Requests
**Filter all outgoing requests**:
```bash
NIGHTWATCH_IGNORE_OUTGOING_REQUESTS=true
```
**Filter by URL**:
```php
use Laravel\Nightwatch\Records\OutgoingRequest;
Nightwatch::rejectOutgoingRequests(function (OutgoingRequest $request) {
return str_contains($request->url, 'analytics.example.com');
});
```
### Queued Jobs
**Filter specific jobs**:
```php
use Laravel\Nightwatch\Records\QueuedJob;
Nightwatch::rejectQueuedJobs(function (QueuedJob $job) {
return $job->name === 'App\Jobs\LowPriorityJob';
});
```
### Decoupling Job Sampling
Sample jobs independently from parent contexts:
```php
use Illuminate\Support\Facades\Queue;
public function boot(): void
{
Queue::before(fn () => Nightwatch::sample(rate: 0.5));
}
```
---
## Redaction Configuration
Redaction modifies captured data to remove or obfuscate sensitive information. Unlike filtering, redaction keeps the event but sanitizes its content.
### Request Redaction
**Redact sensitive headers** (automatically redacts: Authorization, Cookie, X-XSRF-TOKEN):
```bash
# Customize redacted headers
NIGHTWATCH_REDACT_HEADERS=Authorization,Cookie,Proxy-Authorization,X-API-Key
```
**Redact request payloads** (disabled by default):
```bash
# Enable payload capture
NIGHTWATCH_CAPTURE_REQUEST_PAYLOAD=true
# Customize redacted fields
NIGHTWATCH_REDACT_PAYLOAD_FIELDS=password,password_confirmation,ssn,credit_card
```
**Programmatic redaction**:
```php
use Laravel\Nightwatch\Facades\Nightwatch;
use Laravel\Nightwatch\Records\Request;
Nightwatch::redactRequests(function (Request $request) {
$request->url = str_replace('secret', '***', $request->url);
$request->ip = preg_replace('/\d+$/', '***', $request->ip);
});
```
### Query Redaction
```php
use Laravel\Nightwatch\Records\Query;
Nightwatch::redactQueries(function (Query $query) {
$query->sql = str_replace('secret_token', '***', $query->sql);
});
```
### Cache Redaction
```php
use Laravel\Nightwatch\Records\CacheEvent;
Nightwatch::redactCacheEvents(function (CacheEvent $cacheEvent) {
$cacheEvent->key = str_replace('user:', 'user:***:', $cacheEvent->key);
});
```
### Command Redaction
```php
use Laravel\Nightwatch\Records\Command;
Nightwatch::redactCommands(function (Command $command) {
$command->command = preg_replace('/--password=\S+/', '--password=***', $command->command);
});
```
### Exception Redaction
```php
use Laravel\Nightwatch\Records\Exception;
Nightwatch::redactExceptions(function (Exception $exception) {
$exception->message = str_replace('secret', '***', $exception->message);
});
```
### Mail Redaction
```php
use Laravel\Nightwatch\Records\Mail;
Nightwatch::redactMail(function (Mail $mail) {
$mail->subject = str_replace('Invoice #', 'Invoice ***', $mail->subject);
});
```
### Outgoing Request Redaction
```php
use Laravel\Nightwatch\Records\OutgoingRequest;
Nightwatch::redactOutgoingRequests(function (OutgoingRequest $outgoingRequest) {
$outgoingRequest->url = preg_replace('/api_key=\w+/', 'api_key=***', $outgoingRequest->url);
});
```

View file

@ -0,0 +1,108 @@
# Nightwatch Configuration Reference
## Configuration Summary by Event Type
| Event Type | Sampling | Filtering | Redaction |
| --------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------- |
| **Requests** | `NIGHTWATCH_REQUEST_SAMPLE_RATE`, Route middleware | Not applicable | Headers, payload, URL, IP |
| **Commands** | `NIGHTWATCH_COMMAND_SAMPLE_RATE`, Event listener | Not applicable | Command arguments |
| **Queries** | Parent context | `rejectQueries()`, `NIGHTWATCH_IGNORE_QUERIES` | SQL statement |
| **Cache** | Parent context | `rejectCacheKeys()`, `rejectCacheEvents()`, `NIGHTWATCH_IGNORE_CACHE_EVENTS` | Cache key |
| **Jobs** | Parent context, Queue::before | `rejectQueuedJobs()` | Not applicable |
| **Mail** | Parent context | `rejectMail()`, `NIGHTWATCH_IGNORE_MAIL` | Subject |
| **Notifications** | Parent context | `rejectNotifications()`, `NIGHTWATCH_IGNORE_NOTIFICATIONS` | Not applicable |
| **Outgoing Requests** | Parent context | `rejectOutgoingRequests()`, `NIGHTWATCH_IGNORE_OUTGOING_REQUESTS` | URL |
| **Exceptions** | `NIGHTWATCH_EXCEPTION_SAMPLE_RATE` | Not applicable | Exception message |
---
## Production Recommendations
### High-Traffic Applications
```bash
# Conservative sampling
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.01 # 1% of requests
NIGHTWATCH_COMMAND_SAMPLE_RATE=0.1 # 10% of commands
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0 # Always capture exceptions
# Filter noisy events
NIGHTWATCH_IGNORE_CACHE_EVENTS=true
NIGHTWATCH_IGNORE_QUERIES=true # Or filter specific queries programmatically
```
### Privacy-Conscious Applications
```bash
# Disable sensitive data collection
NIGHTWATCH_CAPTURE_REQUEST_PAYLOAD=false
NIGHTWATCH_REDACT_HEADERS=Authorization,Cookie,Proxy-Authorization,X-XSRF-TOKEN
# Or use redaction in AppServiceProvider
```
### Balanced Configuration (Recommended Start)
```bash
# Sample rates
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.1
NIGHTWATCH_COMMAND_SAMPLE_RATE=1.0
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0
# Filter obvious noise programmatically
# Redact PII as needed
```
---
## Verification Checklist
After configuration:
- [ ] Sampling rates appropriate for traffic volume
- [ ] Noisy events filtered (cache, certain queries)
- [ ] Sensitive data redacted (PII, tokens, credentials)
- [ ] Exceptions always captured for debugging
- [ ] Test in development with `NIGHTWATCH_REQUEST_SAMPLE_RATE=1.0`
- [ ] Monitor event quota usage in Nightwatch dashboard
---
## Common Patterns
### Filter Health Checks + Reduce Sampling
```php
Route::get('/health', fn() => ['status' => 'ok'])
->middleware(Sample::never());
```
### Exclude Internal/Vendor Queries
```php
Nightwatch::rejectQueries(fn($q) =>
str_contains($q->sql, 'telescope') ||
str_contains($q->sql, 'pulse')
);
```
### Protect User Data in Cache Keys
```php
Nightwatch::redactCacheEvents(fn($e) =>
$e->key = preg_replace('/user:\d+/', 'user:***', $e->key)
);
```

View file

@ -82,4 +82,4 @@ ## Common Pitfalls
- The `environments` array overrides only the keys you specify. It merges into `defaults` and does not replace it.
- The timeout chain must be ordered: job `timeout` less than supervisor `timeout` less than `retry_after`. The wrong order can cause jobs to be retried before Horizon finishes timing them out.
- The metrics dashboard stays blank until `horizon:snapshot` is scheduled. Running `php artisan horizon` alone does not populate metrics.
- Always use `search-docs` for the latest Horizon documentation rather than relying on this skill alone.
- Always use `search-docs` for the latest Horizon documentation rather than relying on this skill alone.

View file

@ -18,4 +18,4 @@ ### Register the snapshot in the scheduler rather than running it manually
### `metrics.trim_snapshots` is a snapshot count, not a time duration
The `trim_snapshots.job` and `trim_snapshots.queue` values in `config/horizon.php` are counts of snapshots to keep, not minutes or hours. With the default of 24 snapshots at 5-minute intervals, that provides 2 hours of history. Increase the value to retain more history at the cost of Redis memory usage.
The `trim_snapshots.job` and `trim_snapshots.queue` values in `config/horizon.php` are counts of snapshots to keep, not minutes or hours. With the default of 24 snapshots at 5-minute intervals, that provides 2 hours of history. Increase the value to retain more history at the cost of Redis memory usage.

View file

@ -18,4 +18,4 @@ ### Use Horizon's built-in notification routing in `HorizonServiceProvider`
### Failed job alerts are separate from Horizon's documented notification routing
Horizon's 12.x documentation covers built-in long-wait notifications. Do not assume the docs provide a `JobFailed` listener example in `HorizonServiceProvider`. If a user needs failed job alerts, treat that as custom queue event handling and consult the queue documentation instead of Horizon's notification-routing API.
Horizon's 12.x documentation covers built-in long-wait notifications. Do not assume the docs provide a `JobFailed` listener example in `HorizonServiceProvider`. If a user needs failed job alerts, treat that as custom queue event handling and consult the queue documentation instead of Horizon's notification-routing API.

View file

@ -24,4 +24,4 @@ ### Use `balance: false` to keep a fixed number of workers on a dedicated queue
### Set `balanceCooldown` to prevent rapid worker scaling under bursty load
When using `balance: auto`, the supervisor can scale up and down rapidly under bursty load. Set `balanceCooldown` to the number of seconds between scaling decisions, typically 3 to 5, to smooth this out. `balanceMaxShift` limits how many processes are added or removed per cycle.
When using `balance: auto`, the supervisor can scale up and down rapidly under bursty load. Set `balanceCooldown` to the number of seconds between scaling decisions, typically 3 to 5, to smooth this out. `balanceMaxShift` limits how many processes are added or removed per cycle.

View file

@ -18,4 +18,4 @@ ### `silenced` hides jobs from the dashboard completed list but does not stop th
### `silenced_tags` hides all jobs carrying a matching tag from the completed list
Any job carrying a matching tag string is hidden from the completed jobs view. This is useful for silencing a category of jobs such as all jobs tagged `notifications`, rather than silencing specific classes.
Any job carrying a matching tag string is hidden from the completed jobs view. This is useful for silencing a category of jobs such as all jobs tagged `notifications`, rather than silencing specific classes.

View file

@ -411,4 +411,4 @@ ## Payload Type Reference
| `remove` | (empty) | Remove entry |
| `confetti` | (empty) | Confetti animation |
| `show_app` | (empty) | Show Ray window |
| `hide_app` | (empty) | Hide Ray window |
| `hide_app` | (empty) | Hide Ray window |

View file

@ -1,6 +1,6 @@
---
name: fortify-development
description: 'ACTIVATE when the user works on authentication in Laravel. This includes login, registration, password reset, email verification, two-factor authentication (2FA/TOTP/QR codes/recovery codes), profile updates, password confirmation, or any auth-related routes and controllers. Activate when the user mentions Fortify, auth, authentication, login, register, signup, forgot password, verify email, 2FA, or references app/Actions/Fortify/, CreateNewUser, UpdateUserProfileInformation, FortifyServiceProvider, config/fortify.php, or auth guards. Fortify is the frontend-agnostic authentication backend for Laravel that registers all auth routes and controllers. Also activate when building SPA or headless authentication, customizing login redirects, overriding response contracts like LoginResponse, or configuring login throttling. Do NOT activate for Laravel Passport (OAuth2 API tokens), Socialite (OAuth social login), or non-auth Laravel features.'
description: 'ACTIVATE when the user works on authentication in Laravel. This includes login, registration, password reset, email verification, two-factor authentication (2FA/TOTP/QR codes/recovery codes), passkeys, profile updates, password confirmation, or any auth-related routes and controllers. Activate when the user mentions Fortify, auth, authentication, login, register, signup, forgot password, verify email, 2FA, passkeys, WebAuthn, or references app/Actions/Fortify/, CreateNewUser, UpdateUserProfileInformation, FortifyServiceProvider, config/fortify.php, or auth guards. Fortify is the frontend-agnostic authentication backend for Laravel that registers all auth routes and controllers. Also activate when building SPA or headless authentication, customizing login redirects, overriding response contracts like LoginResponse, or configuring login throttling. Do NOT activate for Laravel Passport (OAuth2 API tokens), Socialite (OAuth social login), or non-auth Laravel features.'
license: MIT
metadata:
author: laravel
@ -32,6 +32,7 @@ ## Available Features
- `Features::updateProfileInformation()` - Profile updates
- `Features::updatePasswords()` - Password changes
- `Features::twoFactorAuthentication()` - 2FA with QR codes and recovery codes
- `Features::passkeys()` - Passwordless authentication with WebAuthn passkeys
> Use `search-docs` for feature configuration options and customization patterns.
@ -50,6 +51,18 @@ ### Two-Factor Authentication Setup
> Use `search-docs` for TOTP implementation and recovery code handling patterns.
### Passkeys Setup
```
- [ ] Add PasskeyAuthenticatable trait to User model and implement PasskeyUser
- [ ] Enable passkeys feature in config/fortify.php
- [ ] If the passkeys table migration is missing, publish via `php artisan vendor:publish --tag=fortify-migrations` and migrate
- [ ] Configure passkeys relying_party_id, allowed_origins, user_handle_secret, and timeout if defaults are not suitable
- [ ] Build UI with @laravel/passkeys for registration, login, confirmation, and deletion
```
> Use `search-docs` for passkey configuration options. For `@laravel/passkeys` frontend usage, refer to the package's README on npm.
### Email Verification Setup
```
@ -128,4 +141,11 @@ ## Key Endpoints
| Confirm 2FA | POST | `/user/confirmed-two-factor-authentication` |
| 2FA Challenge | POST | `/two-factor-challenge` |
| Get QR Code | GET | `/user/two-factor-qr-code` |
| Recovery Codes | GET/POST | `/user/two-factor-recovery-codes` |
| Recovery Codes | GET/POST | `/user/two-factor-recovery-codes` |
| Passkey Login Options | GET | `/passkeys/login/options` |
| Passkey Login | POST | `/passkeys/login` |
| Passkey Confirm Options| GET | `/passkeys/confirm/options` |
| Passkey Confirm | POST | `/passkeys/confirm` |
| Passkey Options | GET | `/user/passkeys/options` |
| Register Passkey | POST | `/user/passkeys` |
| Delete Passkey | DELETE | `/user/passkeys/{passkey}` |

View file

@ -299,4 +299,4 @@ ## Topic References
- Command entrypoint: `references/command.md`
- With attributes: `references/with-attributes.md`
- Testing and fakes: `references/testing-fakes.md`
- Troubleshooting: `references/troubleshooting.md`
- Troubleshooting: `references/troubleshooting.md`

View file

@ -157,4 +157,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-command.html
- https://www.laravelactions.com/2.x/as-command.html

View file

@ -336,4 +336,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-controller.html
- https://www.laravelactions.com/2.x/as-controller.html

View file

@ -422,4 +422,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-job.html
- https://www.laravelactions.com/2.x/as-job.html

View file

@ -78,4 +78,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-listener.html
- https://www.laravelactions.com/2.x/as-listener.html

View file

@ -115,4 +115,4 @@ ### Dependency injection invocation
return $this->publishArticle->handle($articleId);
}
}
```
```

View file

@ -157,4 +157,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-fake.html
- https://www.laravelactions.com/2.x/as-fake.html

View file

@ -30,4 +30,4 @@ ## Debug checklist
- Reproduce with a focused failing test.
- Validate wiring layer first, then domain behavior.
- Isolate dependencies with fakes/spies where appropriate.
- Isolate dependencies with fakes/spies where appropriate.

View file

@ -186,4 +186,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/with-attributes.html
- https://www.laravelactions.com/2.x/with-attributes.html

View file

@ -94,7 +94,7 @@ ### 8. Testing Patterns → `rules/testing.md`
### 9. Queue & Job Patterns → `rules/queue-jobs.md`
- `retry_after` must exceed job `timeout`; use exponential backoff `[1, 5, 10]`
- `ShouldBeUnique` to prevent duplicates; `WithoutOverlapping::untilProcessing()` for concurrency
- `ShouldBeUnique` to prevent duplicates; `ShouldBeUniqueUntilProcessing` for early lock release
- Always implement `failed()`; with `retryUntil()`, set `$tries = 0`
- `RateLimited` middleware for external API calls; `Bus::batch()` for related jobs
- Horizon for complex multi-queue scenarios
@ -187,4 +187,4 @@ ## How to Apply
1. Identify the file type and select relevant sections (e.g., migration → §16, controller → §1, §3, §5, §6, §10)
2. Check sibling files for existing patterns — follow those first per Consistency First
3. Verify API syntax with `search-docs` for the installed Laravel version
3. Verify API syntax with `search-docs` for the installed Laravel version

View file

@ -103,4 +103,4 @@ ## Use Correlated Subqueries for Has-Many Ordering
->take(1)
);
}
```
```

View file

@ -82,7 +82,7 @@ ## Code to Interfaces
## Default Sort by Descending
When no explicit order is specified, sort by `id` or `created_at` descending. Explicit ordering prevents cross-database inconsistencies between MySQL and Postgres.
When no explicit order is specified, sort by `id` or `created_at` descending. Without an explicit `ORDER BY`, row order is undefined.
Incorrect:
```php
@ -199,4 +199,4 @@ ## Convention Over Configuration
return $this->belongsToMany(Role::class);
}
}
```
```

View file

@ -33,4 +33,4 @@ ## Use Blade Fragments for Partial Re-Renders (htmx/Turbo)
## Use `@aware` for Deeply Nested Component Props
Avoids re-passing parent props through every level of nested components.
Avoids re-passing parent props through every level of nested components.

View file

@ -2,7 +2,7 @@ # Caching Best Practices
## Use `Cache::remember()` Instead of Manual Get/Put
Atomic pattern prevents race conditions and removes boilerplate.
Cleaner cache-aside pattern that removes boilerplate. use `Cache::lock()` for race conditions.
Incorrect:
```php
@ -67,4 +67,4 @@ ## Configure Failover Cache Stores in Production
```php
'failover' => ['driver' => 'failover', 'stores' => ['redis', 'database']],
```
```

View file

@ -41,4 +41,4 @@ ## Use `#[CollectedBy]` for Custom Collection Classes
```php
#[CollectedBy(UserCollection::class)]
class User extends Model {}
```
```

View file

@ -2,7 +2,7 @@ # Configuration Best Practices
## `env()` Only in Config Files
Direct `env()` calls return `null` when config is cached.
Direct `env()` calls may return `null` when config is cached.
Incorrect:
```php
@ -70,4 +70,4 @@ ## Use Constants and Language Files
```php
// Only when lang files already exist in the project
return back()->with('message', __('app.article_added'));
```
```

View file

@ -189,4 +189,4 @@ ## No Queries in Blade Templates
@foreach ($users as $user)
{{ $user->profile->name }}
@endforeach
```
```

View file

@ -145,4 +145,4 @@ ## Avoid Hardcoded Table Names in Queries
Prefer Eloquent queries and relationships over `DB::table()` whenever possible — they already reference the model's table. When `DB::table()` or raw joins are unavoidable, always use `(new Model)->getTable()` to keep the reference traceable.
**Exception — migrations:** In migrations, hardcoded table names via `DB::table('settings')` are acceptable and preferred. Models change over time but migrations are frozen snapshots — referencing a model that is later renamed or deleted would break the migration.
**Exception — migrations:** In migrations, hardcoded table names via `DB::table('settings')` are acceptable and preferred. Models change over time but migrations are frozen snapshots — referencing a model that is later renamed or deleted would break the migration.

View file

@ -69,4 +69,4 @@ ## Add Context to Exception Classes
return ['order_id' => $this->orderId];
}
}
```
```

View file

@ -29,7 +29,11 @@ ## Always Queue Notifications
## Use `afterCommit()` on Notifications in Transactions
Same race condition as events — the queued notification job may run before the transaction commits.
Same race condition as events — call `afterCommit()` to delay dispatch until the transaction commits.
```php
$user->notify((new InvoicePaid($invoice))->afterCommit());
```
## Route Notification Channels to Dedicated Queues
@ -45,4 +49,4 @@ ## Use On-Demand Notifications for Non-User Recipients
## Implement `HasLocalePreference` on Notifiable Models
Laravel automatically uses the user's preferred locale for all notifications and mailables — no per-call `locale()` needed.
Laravel automatically uses the user's preferred locale for all notifications and mailables — no per-call `locale()` needed.

View file

@ -52,7 +52,7 @@ ## Use Retry with Backoff for External APIs
Only retry on specific errors:
```php
$response = Http::retry(3, 100, function (Exception $exception, PendingRequest $request) {
$response = Http::retry(3, 100, function (Throwable $exception, PendingRequest $request) {
return $exception instanceof ConnectionException
|| ($exception instanceof RequestException && $exception->response->serverError());
})->post('https://api.example.com/data');
@ -157,4 +157,4 @@ ## Fake HTTP Calls in Tests
Http::fake([
'api.example.com/*' => Http::failedConnection(),
]);
```
```

View file

@ -10,7 +10,7 @@ ## Use `afterCommit()` on Mailables Inside Transactions
## Use `assertQueued()` Not `assertSent()` for Queued Mailables
`Mail::assertSent()` only catches synchronous mail. Queued mailables silently pass `assertSent`, giving false confidence.
`Mail::assertSent()` only catches synchronous mail. Queued mailables fail `assertSent` with a "Did you mean to use assertQueued()?" hint.
Incorrect: `Mail::assertSent(OrderShipped::class);` when mailable implements `ShouldQueue`.
@ -24,4 +24,4 @@ ## Separate Content Tests from Sending Tests
Content tests: instantiate the mailable directly, call `assertSeeInHtml()`.
Sending tests: use `Mail::fake()` and `assertSent()`/`assertQueued()`.
Don't mix them — it conflates concerns and makes tests brittle.
Don't mix them — it conflates concerns and makes tests brittle.

View file

@ -118,4 +118,4 @@ ## Keep Migrations Focused
// Migration 2: seed_default_settings
DB::table('settings')->insert(['key' => 'version', 'value' => '1.0']);
```
```

View file

@ -106,25 +106,23 @@ ## `retryUntil()` Needs `$tries = 0`
```php
public $tries = 0;
public function retryUntil(): DateTime
public function retryUntil(): \DateTimeInterface
{
return now()->addHours(4);
}
```
## Use `WithoutOverlapping::untilProcessing()`
## Use `ShouldBeUniqueUntilProcessing` for Early Lock Release
Prevents concurrent execution while allowing new instances to queue.
`ShouldBeUnique` holds the lock until the job completes. `ShouldBeUniqueUntilProcessing` releases it when processing starts, allowing new instances to queue.
```php
public function middleware(): array
class UpdateSearchIndex implements ShouldQueue, ShouldBeUniqueUntilProcessing
{
return [new WithoutOverlapping($this->product->id)->untilProcessing()];
// Lock releases when processing begins, not when it finishes
}
```
Without `untilProcessing()`, the lock extends through queue wait time. With it, the lock releases when processing starts.
## Use Horizon for Complex Queue Scenarios
Use Laravel Horizon when you need monitoring, auto-scaling, failure tracking, or multiple queues with different priorities.
@ -143,4 +141,4 @@ ## Use Horizon for Complex Queue Scenarios
],
],
],
```
```

View file

@ -36,7 +36,8 @@ ## Use Resource Controllers
```php
Route::resource('posts', PostController::class);
Route::apiResource('api/posts', Api\PostController::class);
// In routes/api.php — the /api prefix is applied automatically
Route::apiResource('posts', Api\PostController::class);
```
## Keep Controllers Thin
@ -95,4 +96,4 @@ ## Type-Hint Form Requests
return redirect()->route('posts.index');
}
```
```

View file

@ -36,4 +36,4 @@ ## Use Schedule Groups for Shared Configuration
Schedule::command('emails:send --force');
Schedule::command('emails:prune');
});
```
```

View file

@ -32,7 +32,7 @@ ## Authorize Every Action
Incorrect:
```php
public function update(Request $request, Post $post)
public function update(UpdatePostRequest $request, Post $post)
{
$post->update($request->validated());
}
@ -90,7 +90,7 @@ ## Escape Output to Prevent XSS
## CSRF Protection
Include `@csrf` in all POST/PUT/DELETE Blade forms. Not needed in Inertia.
Include `@csrf` in all POST/PUT/DELETE Blade forms. In Inertia apps, the `@csrf` directive is automatically applied.
Incorrect:
```blade
@ -121,7 +121,7 @@ ## Rate Limit Auth and API Routes
## Validate File Uploads
Validate MIME type, extension, and size. Never trust client-provided filenames.
Validate extension, MIME type, and size. The `mimes` rule checks extensions; use `mimetypes` for actual MIME type validation. Never trust client-provided filenames.
```php
public function rules(): array
@ -195,4 +195,4 @@ ## Encrypt Sensitive Database Fields
];
}
}
```
```

View file

@ -2,7 +2,7 @@ # Testing Best Practices
## Use `LazilyRefreshDatabase` Over `RefreshDatabase`
`RefreshDatabase` runs all migrations every test run even when the schema hasn't changed. `LazilyRefreshDatabase` only migrates when needed, significantly speeding up large suites.
`RefreshDatabase` migrates once per process and wraps each test in a rolled-back transaction. `LazilyRefreshDatabase` skips even that first migration if the schema is already up to date.
## Use Model Assertions Over Raw Database Assertions
@ -40,4 +40,4 @@ ## Use `recycle()` to Share Relationship Instances Across Factories
Ticket::factory()
->recycle(Airline::factory()->create())
->create();
```
```

View file

@ -72,4 +72,4 @@ ## Use the `after()` Method for Custom Validation
},
];
}
```
```

View file

@ -112,4 +112,4 @@ ## Common Pitfalls
- Forgetting `wire:key` in loops causes unexpected behavior when items change
- Using `wire:model` expecting real-time updates (use `wire:model.live` instead in v3)
- Not validating/authorizing in Livewire actions (treat them like HTTP requests)
- Including Alpine.js separately when it's already bundled with Livewire 3
- Including Alpine.js separately when it's already bundled with Livewire 3

View file

@ -0,0 +1,96 @@
---
name: mcp-development
description: "Use this skill for Laravel MCP development only. Trigger when creating or editing MCP tools, resources, prompts, or servers in Laravel projects. Covers: artisan make:mcp-* generators, mcp:inspector, routes/ai.php, Tool/Resource/Prompt classes, schema validation, shouldRegister(), OAuth setup, URI templates, read-only attributes, and MCP debugging. Do not use for non-Laravel MCP projects or generic AI features without MCP."
license: MIT
metadata:
author: laravel
---
# MCP Development
## Documentation
Use `search-docs` for detailed Laravel MCP patterns and documentation.
## Basic Usage
Register MCP servers in `routes/ai.php`:
<!-- Register MCP Server -->
```php
use Laravel\Mcp\Facades\Mcp;
Mcp::web();
```
### Creating MCP Primitives
Create MCP tools, resources, prompts, and servers using artisan commands:
```bash
php artisan make:mcp-tool ToolName # Create a tool
php artisan make:mcp-resource ResourceName # Create a resource
php artisan make:mcp-prompt PromptName # Create a prompt
php artisan make:mcp-server ServerName # Create a server
```
After creating primitives, register them in your server's `$tools`, `$resources`, or `$prompts` properties.
### Tools
<!-- MCP Tool Example -->
```php
use Laravel\Mcp\Server\Tool;
use Laravel\Mcp\Server\Request;
use Laravel\Mcp\Server\Response;
class MyTool extends Tool
{
public function handle(Request $request): Response
{
return new Response(['result' => 'success']);
}
}
```
### Registering Primitives in a Server
Each MCP server must explicitly declare the tools, resources, and prompts it exposes.
<!-- Register Primitives in MCP Server -->
```php
use Laravel\Mcp\Server;
class AppServer extends Server
{
protected array $tools = [
\App\Mcp\Tools\MyTool::class,
];
protected array $resources = [
\App\Mcp\Resources\MyResource::class,
];
protected array $prompts = [
\App\Mcp\Prompts\MyPrompt::class,
];
}
```
## Verification
1. Check `routes/ai.php` for proper registration
2. Test tool via MCP client
## Common Pitfalls
- Running `mcp:start` command (it hangs waiting for input)
- Using HTTPS locally with Node-based MCP clients
- Not using `search-docs` for the latest MCP documentation
- Not registering MCP server routes in `routes/ai.php`
- Do not register `ai.php` in `bootstrap.php`; it is registered automatically.
- OAuth registration supports custom URI schemes (e.g., `cursor://`, `vscode://`) for native desktop clients via `mcp.custom_schemes` config

View file

@ -1,6 +1,6 @@
---
name: pest-testing
description: "Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to write something in Pest, mentions test files or directories (tests/Feature, tests/Unit, tests/Browser), or needs browser testing, smoke testing multiple pages for JS errors, or architecture tests. Covers: it()/expect() syntax, datasets, mocking, browser testing (visit/click/fill), smoke testing, arch(), Livewire component tests, RefreshDatabase, and all Pest 4 features. Do not use for factories, seeders, migrations, controllers, models, or non-test PHP code."
description: "Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to write something in Pest, mentions test files or directories (tests/Feature, tests/Unit, tests/Browser), or needs browser testing, smoke testing multiple pages for JS errors, or architecture tests. Covers: test()/it()/expect() syntax, datasets, mocking, browser testing (visit/click/fill), smoke testing, arch(), Livewire component tests, RefreshDatabase, and all Pest 4 features. Do not use for factories, seeders, migrations, controllers, models, or non-test PHP code."
license: MIT
metadata:
author: laravel
@ -18,6 +18,12 @@ ### Creating Tests
All tests must be written using Pest. Use `php artisan make:test --pest {name}`.
The `{name}` argument should include only the path and test name, but should not include the test suite.
- Incorrect: `php artisan make:test --pest Feature/SomeFeatureTest` will generate `tests/Feature/Feature/SomeFeatureTest.php`
- Correct: `php artisan make:test --pest SomeControllerTest` will generate `tests/Feature/SomeControllerTest.php`
- Incorrect: `php artisan make:test --pest --unit Unit/SomeServiceTest` will generate `tests/Unit/Unit/SomeServiceTest.php`
- Correct: `php artisan make:test --pest --unit SomeServiceTest` will generate `tests/Unit/SomeServiceTest.php`
### Test Organization
- Unit/Feature tests: `tests/Feature` and `tests/Unit` directories.
@ -26,6 +32,8 @@ ### Test Organization
### Basic Test Structure
Pest supports both `test()` and `it()` functions. Before writing new tests, check existing test files in the same directory to match the project's convention. Use `test()` if existing tests use `test()`, or `it()` if they use `it()`.
<!-- Basic Pest Test Example -->
```php
it('is true', function () {
@ -154,4 +162,5 @@ ## Common Pitfalls
- Using `assertStatus(200)` instead of `assertSuccessful()`
- Forgetting datasets for repetitive validation tests
- Deleting tests without approval
- Forgetting `assertNoJavaScriptErrors()` in browser tests
- Forgetting `assertNoJavaScriptErrors()` in browser tests
- Prefixing `Feature/` or `Unit/` in `{name}` when using `make:test`

View file

@ -77,4 +77,4 @@ ## Common Pitfalls
- Redirect URL in `config/services.php` must exactly match the provider's OAuth dashboard (including trailing slashes and protocol).
- Do not pass `state`, `response_type`, `client_id`, `redirect_uri`, or `scope` via `with()` — these are reserved.
- Community providers require event listener registration via `SocialiteWasCalled`.
- `user()` throws when the user declines authorization. Always handle denied grants.
- `user()` throws when the user declines authorization. Always handle denied grants.

View file

@ -116,4 +116,4 @@ ## Common Pitfalls
- Using `@tailwind` directives instead of `@import "tailwindcss"`
- Trying to use `tailwind.config.js` instead of CSS `@theme` directive
- Using margins for spacing between siblings instead of gap utilities
- Forgetting to add dark mode variants when the project uses dark mode
- Forgetting to add dark mode variants when the project uses dark mode

View file

@ -0,0 +1,404 @@
---
name: configure-nightwatch
description: Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies. Use when setting up Nightwatch, managing data volume, protecting sensitive data (PII), or optimizing event collection for production workloads.
license: MIT
metadata:
author: laravel
---
# Nightwatch Configuration Guide
This skill helps configure Laravel Nightwatch data collection to balance observability, performance, and privacy. Covers sampling strategies, filtering rules, and redaction methods across all event types.
## Documentation Reference
The [Nightwatch Documentation](https://nightwatch.laravel.com/docs) is the definitive and up-to-date source of information for all Nightwatch configuration options. This skill provides practical guidance and common patterns, but always consult the official documentation as the primary source of truth for specific details, environment variables, and API behavior. The documentation includes comprehensive coverage of:
- [Filtering and Configuration](https://nightwatch.laravel.com/docs/filtering) - Core concepts for sampling, filtering, and redaction
- Individual event type pages with specific configuration options:
- [Requests](https://nightwatch.laravel.com/docs/requests) - Request sampling, header handling, payload capture
- [Commands](https://nightwatch.laravel.com/docs/commands) - Command sampling and redaction
- [Queries](https://nightwatch.laravel.com/docs/queries) - Query filtering and redaction
- [Cache](https://nightwatch.laravel.com/docs/cache) - Cache event filtering by key or pattern
- [Jobs](https://nightwatch.laravel.com/docs/jobs) - Job filtering and sampling decoupling
- [Mail](https://nightwatch.laravel.com/docs/mail) - Mail event filtering
- [Notifications](https://nightwatch.laravel.com/docs/notifications) - Notification filtering by channel
- [Exceptions](https://nightwatch.laravel.com/docs/exceptions) - Exception sampling and throttling
- [Outgoing Requests](https://nightwatch.laravel.com/docs/outgoing-requests) - HTTP request filtering
- [reference.md](reference.md) - Quick lookup table by event type, production presets, and verification checklist
## Data Collection Flow
Nightwatch processes events through three stages:
1. **Sampling** - Controls which entry points are captured (requests, commands, scheduled tasks)
2. **Filtering** - Excludes specific events after sampling (queries, cache, mail, etc.)
3. **Redaction** - Modifies captured data to remove/obfuscate sensitive information
```
Request/Command/Scheduled Task
|
v
[Sampling?] ----NO----> Drop entire trace
| YES
v
Events generated
|
v
[Filtering?] ----YES---> Drop specific event
| NO
v
[Redaction] ----------> Store modified data
```
---
## Sampling Configuration
Sampling determines which entry points (requests, commands, scheduled tasks) trigger full trace collection. When an entry point is sampled, all related events are captured.
### Global Sample Rates
Configure via environment variables:
```bash
# Default: 100% sampling (all requests/commands captured)
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.1 # Recommended: 10% of requests
NIGHTWATCH_COMMAND_SAMPLE_RATE=1.0 # Capture all commands
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0 # Always capture exceptions
```
**Recommendation**: Start with `0.1` (10%) for requests in production, adjust based on volume and needs.
### Route-Based Sampling
Apply different rates to specific routes using the `Sample` middleware:
```php routes/web.php
use Illuminate\Support\Facades\Route;
use Laravel\Nightwatch\Http\Middleware\Sample;
// Sample admin routes at 100%
Route::middleware(Sample::rate(1.0))->prefix('admin')->group(function () {
// All admin routes sampled fully
});
// Sample API routes at 5%
Route::middleware(Sample::rate(0.05))->prefix('api')->group(function () {
// API routes sampled sparingly
});
// Always sample critical endpoints
Route::post('/checkout', [CheckoutController::class, 'process'])
->middleware(Sample::always());
// Never sample health checks
Route::get('/health', [HealthController::class, 'check'])
->middleware(Sample::never());
```
### Unmatched Route Sampling
Handle 404/bot traffic with reduced sampling:
```php routes/web.php
Route::fallback(fn () => abort(404))
->middleware(Sample::rate(0.01)); // 1% sampling for unmatched routes
```
### Dynamic Sampling
Sample based on runtime conditions (user role, request attributes):
```php app/Http/Middleware/SampleAdminRequests.php
use Closure;
use Illuminate\Http\Request;
use Laravel\Nightwatch\Facades\Nightwatch;
class SampleAdminRequests
{
public function handle(Request $request, Closure $next)
{
if ($request->user()?->isAdmin()) {
Nightwatch::sample(); // Always sample admin requests
}
return $next($request);
}
}
```
### Command Sampling
Exclude specific commands from sampling:
```php AppServiceProvider.php
use Illuminate\Console\Events\CommandStarting;
use Illuminate\Support\Facades\Event;
use Laravel\Nightwatch\Facades\Nightwatch;
public function boot(): void
{
Event::listen(function (CommandStarting $event) {
if (in_array($event->command, ['schedule:finish', 'horizon:snapshot'])) {
Nightwatch::dontSample();
}
});
}
```
### Vendor Commands
Nightwatch automatically ignores framework/internal commands. Opt-in to capture them:
```php
Nightwatch::captureDefaultVendorCommands();
```
---
## Filtering Configuration
Filtering excludes specific events from collection after sampling. Use filtering to reduce noise and quota usage.
### Database Queries
**Filter all queries** (disable query collection):
```bash
NIGHTWATCH_IGNORE_QUERIES=true
```
**Filter specific queries** by SQL pattern:
```php AppServiceProvider.php
use Laravel\Nightwatch\Facades\Nightwatch;
use Laravel\Nightwatch\Records\Query;
public function boot(): void
{
// Filter job table queries (PostgreSQL)
Nightwatch::rejectQueries(function (Query $query) {
return str_contains($query->sql, 'into "jobs"');
});
// Filter cache table queries (MySQL)
Nightwatch::rejectQueries(function (Query $query) {
return str_contains($query->sql, 'from `cache`')
|| str_contains($query->sql, 'into `cache`');
});
}
```
### Cache Events
**Filter all cache events**:
```bash
NIGHTWATCH_IGNORE_CACHE_EVENTS=true
```
**Filter by cache key patterns**:
```php
Nightwatch::rejectCacheKeys([
'my-app:users', // Exact match
'/^my-app:posts:/', // Regex: starts with my-app:posts:
'/^[a-zA-Z0-9]{40}$/', // Regex: session IDs
]);
```
**Filter with callback**:
```php
use Laravel\Nightwatch\Records\CacheEvent;
Nightwatch::rejectCacheEvents(function (CacheEvent $cacheEvent) {
return str_starts_with($cacheEvent->key, 'temp:');
});
```
### Mail Events
**Filter all mail**:
```bash
NIGHTWATCH_IGNORE_MAIL=true
```
**Filter specific mail**:
```php
use Laravel\Nightwatch\Records\Mail;
Nightwatch::rejectMail(function (Mail $mail) {
return str_contains($mail->subject, 'Newsletter');
});
```
### Notification Events
**Filter all notifications**:
```bash
NIGHTWATCH_IGNORE_NOTIFICATIONS=true
```
**Filter by channel**:
```php
use Laravel\Nightwatch\Records\Notification;
Nightwatch::rejectNotifications(function (Notification $notification) {
return $notification->channel === 'database';
});
```
### Outgoing HTTP Requests
**Filter all outgoing requests**:
```bash
NIGHTWATCH_IGNORE_OUTGOING_REQUESTS=true
```
**Filter by URL**:
```php
use Laravel\Nightwatch\Records\OutgoingRequest;
Nightwatch::rejectOutgoingRequests(function (OutgoingRequest $request) {
return str_contains($request->url, 'analytics.example.com');
});
```
### Queued Jobs
**Filter specific jobs**:
```php
use Laravel\Nightwatch\Records\QueuedJob;
Nightwatch::rejectQueuedJobs(function (QueuedJob $job) {
return $job->name === 'App\Jobs\LowPriorityJob';
});
```
### Decoupling Job Sampling
Sample jobs independently from parent contexts:
```php
use Illuminate\Support\Facades\Queue;
public function boot(): void
{
Queue::before(fn () => Nightwatch::sample(rate: 0.5));
}
```
---
## Redaction Configuration
Redaction modifies captured data to remove or obfuscate sensitive information. Unlike filtering, redaction keeps the event but sanitizes its content.
### Request Redaction
**Redact sensitive headers** (automatically redacts: Authorization, Cookie, X-XSRF-TOKEN):
```bash
# Customize redacted headers
NIGHTWATCH_REDACT_HEADERS=Authorization,Cookie,Proxy-Authorization,X-API-Key
```
**Redact request payloads** (disabled by default):
```bash
# Enable payload capture
NIGHTWATCH_CAPTURE_REQUEST_PAYLOAD=true
# Customize redacted fields
NIGHTWATCH_REDACT_PAYLOAD_FIELDS=password,password_confirmation,ssn,credit_card
```
**Programmatic redaction**:
```php
use Laravel\Nightwatch\Facades\Nightwatch;
use Laravel\Nightwatch\Records\Request;
Nightwatch::redactRequests(function (Request $request) {
$request->url = str_replace('secret', '***', $request->url);
$request->ip = preg_replace('/\d+$/', '***', $request->ip);
});
```
### Query Redaction
```php
use Laravel\Nightwatch\Records\Query;
Nightwatch::redactQueries(function (Query $query) {
$query->sql = str_replace('secret_token', '***', $query->sql);
});
```
### Cache Redaction
```php
use Laravel\Nightwatch\Records\CacheEvent;
Nightwatch::redactCacheEvents(function (CacheEvent $cacheEvent) {
$cacheEvent->key = str_replace('user:', 'user:***:', $cacheEvent->key);
});
```
### Command Redaction
```php
use Laravel\Nightwatch\Records\Command;
Nightwatch::redactCommands(function (Command $command) {
$command->command = preg_replace('/--password=\S+/', '--password=***', $command->command);
});
```
### Exception Redaction
```php
use Laravel\Nightwatch\Records\Exception;
Nightwatch::redactExceptions(function (Exception $exception) {
$exception->message = str_replace('secret', '***', $exception->message);
});
```
### Mail Redaction
```php
use Laravel\Nightwatch\Records\Mail;
Nightwatch::redactMail(function (Mail $mail) {
$mail->subject = str_replace('Invoice #', 'Invoice ***', $mail->subject);
});
```
### Outgoing Request Redaction
```php
use Laravel\Nightwatch\Records\OutgoingRequest;
Nightwatch::redactOutgoingRequests(function (OutgoingRequest $outgoingRequest) {
$outgoingRequest->url = preg_replace('/api_key=\w+/', 'api_key=***', $outgoingRequest->url);
});
```

View file

@ -0,0 +1,108 @@
# Nightwatch Configuration Reference
## Configuration Summary by Event Type
| Event Type | Sampling | Filtering | Redaction |
| --------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------- |
| **Requests** | `NIGHTWATCH_REQUEST_SAMPLE_RATE`, Route middleware | Not applicable | Headers, payload, URL, IP |
| **Commands** | `NIGHTWATCH_COMMAND_SAMPLE_RATE`, Event listener | Not applicable | Command arguments |
| **Queries** | Parent context | `rejectQueries()`, `NIGHTWATCH_IGNORE_QUERIES` | SQL statement |
| **Cache** | Parent context | `rejectCacheKeys()`, `rejectCacheEvents()`, `NIGHTWATCH_IGNORE_CACHE_EVENTS` | Cache key |
| **Jobs** | Parent context, Queue::before | `rejectQueuedJobs()` | Not applicable |
| **Mail** | Parent context | `rejectMail()`, `NIGHTWATCH_IGNORE_MAIL` | Subject |
| **Notifications** | Parent context | `rejectNotifications()`, `NIGHTWATCH_IGNORE_NOTIFICATIONS` | Not applicable |
| **Outgoing Requests** | Parent context | `rejectOutgoingRequests()`, `NIGHTWATCH_IGNORE_OUTGOING_REQUESTS` | URL |
| **Exceptions** | `NIGHTWATCH_EXCEPTION_SAMPLE_RATE` | Not applicable | Exception message |
---
## Production Recommendations
### High-Traffic Applications
```bash
# Conservative sampling
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.01 # 1% of requests
NIGHTWATCH_COMMAND_SAMPLE_RATE=0.1 # 10% of commands
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0 # Always capture exceptions
# Filter noisy events
NIGHTWATCH_IGNORE_CACHE_EVENTS=true
NIGHTWATCH_IGNORE_QUERIES=true # Or filter specific queries programmatically
```
### Privacy-Conscious Applications
```bash
# Disable sensitive data collection
NIGHTWATCH_CAPTURE_REQUEST_PAYLOAD=false
NIGHTWATCH_REDACT_HEADERS=Authorization,Cookie,Proxy-Authorization,X-XSRF-TOKEN
# Or use redaction in AppServiceProvider
```
### Balanced Configuration (Recommended Start)
```bash
# Sample rates
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.1
NIGHTWATCH_COMMAND_SAMPLE_RATE=1.0
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0
# Filter obvious noise programmatically
# Redact PII as needed
```
---
## Verification Checklist
After configuration:
- [ ] Sampling rates appropriate for traffic volume
- [ ] Noisy events filtered (cache, certain queries)
- [ ] Sensitive data redacted (PII, tokens, credentials)
- [ ] Exceptions always captured for debugging
- [ ] Test in development with `NIGHTWATCH_REQUEST_SAMPLE_RATE=1.0`
- [ ] Monitor event quota usage in Nightwatch dashboard
---
## Common Patterns
### Filter Health Checks + Reduce Sampling
```php
Route::get('/health', fn() => ['status' => 'ok'])
->middleware(Sample::never());
```
### Exclude Internal/Vendor Queries
```php
Nightwatch::rejectQueries(fn($q) =>
str_contains($q->sql, 'telescope') ||
str_contains($q->sql, 'pulse')
);
```
### Protect User Data in Cache Keys
```php
Nightwatch::redactCacheEvents(fn($e) =>
$e->key = preg_replace('/user:\d+/', 'user:***', $e->key)
);
```

View file

@ -82,4 +82,4 @@ ## Common Pitfalls
- The `environments` array overrides only the keys you specify. It merges into `defaults` and does not replace it.
- The timeout chain must be ordered: job `timeout` less than supervisor `timeout` less than `retry_after`. The wrong order can cause jobs to be retried before Horizon finishes timing them out.
- The metrics dashboard stays blank until `horizon:snapshot` is scheduled. Running `php artisan horizon` alone does not populate metrics.
- Always use `search-docs` for the latest Horizon documentation rather than relying on this skill alone.
- Always use `search-docs` for the latest Horizon documentation rather than relying on this skill alone.

View file

@ -18,4 +18,4 @@ ### Register the snapshot in the scheduler rather than running it manually
### `metrics.trim_snapshots` is a snapshot count, not a time duration
The `trim_snapshots.job` and `trim_snapshots.queue` values in `config/horizon.php` are counts of snapshots to keep, not minutes or hours. With the default of 24 snapshots at 5-minute intervals, that provides 2 hours of history. Increase the value to retain more history at the cost of Redis memory usage.
The `trim_snapshots.job` and `trim_snapshots.queue` values in `config/horizon.php` are counts of snapshots to keep, not minutes or hours. With the default of 24 snapshots at 5-minute intervals, that provides 2 hours of history. Increase the value to retain more history at the cost of Redis memory usage.

View file

@ -18,4 +18,4 @@ ### Use Horizon's built-in notification routing in `HorizonServiceProvider`
### Failed job alerts are separate from Horizon's documented notification routing
Horizon's 12.x documentation covers built-in long-wait notifications. Do not assume the docs provide a `JobFailed` listener example in `HorizonServiceProvider`. If a user needs failed job alerts, treat that as custom queue event handling and consult the queue documentation instead of Horizon's notification-routing API.
Horizon's 12.x documentation covers built-in long-wait notifications. Do not assume the docs provide a `JobFailed` listener example in `HorizonServiceProvider`. If a user needs failed job alerts, treat that as custom queue event handling and consult the queue documentation instead of Horizon's notification-routing API.

View file

@ -24,4 +24,4 @@ ### Use `balance: false` to keep a fixed number of workers on a dedicated queue
### Set `balanceCooldown` to prevent rapid worker scaling under bursty load
When using `balance: auto`, the supervisor can scale up and down rapidly under bursty load. Set `balanceCooldown` to the number of seconds between scaling decisions, typically 3 to 5, to smooth this out. `balanceMaxShift` limits how many processes are added or removed per cycle.
When using `balance: auto`, the supervisor can scale up and down rapidly under bursty load. Set `balanceCooldown` to the number of seconds between scaling decisions, typically 3 to 5, to smooth this out. `balanceMaxShift` limits how many processes are added or removed per cycle.

View file

@ -18,4 +18,4 @@ ### `silenced` hides jobs from the dashboard completed list but does not stop th
### `silenced_tags` hides all jobs carrying a matching tag from the completed list
Any job carrying a matching tag string is hidden from the completed jobs view. This is useful for silencing a category of jobs such as all jobs tagged `notifications`, rather than silencing specific classes.
Any job carrying a matching tag string is hidden from the completed jobs view. This is useful for silencing a category of jobs such as all jobs tagged `notifications`, rather than silencing specific classes.

View file

@ -411,4 +411,4 @@ ## Payload Type Reference
| `remove` | (empty) | Remove entry |
| `confetti` | (empty) | Confetti animation |
| `show_app` | (empty) | Show Ray window |
| `hide_app` | (empty) | Hide Ray window |
| `hide_app` | (empty) | Hide Ray window |

View file

@ -1,6 +1,6 @@
---
name: fortify-development
description: 'ACTIVATE when the user works on authentication in Laravel. This includes login, registration, password reset, email verification, two-factor authentication (2FA/TOTP/QR codes/recovery codes), profile updates, password confirmation, or any auth-related routes and controllers. Activate when the user mentions Fortify, auth, authentication, login, register, signup, forgot password, verify email, 2FA, or references app/Actions/Fortify/, CreateNewUser, UpdateUserProfileInformation, FortifyServiceProvider, config/fortify.php, or auth guards. Fortify is the frontend-agnostic authentication backend for Laravel that registers all auth routes and controllers. Also activate when building SPA or headless authentication, customizing login redirects, overriding response contracts like LoginResponse, or configuring login throttling. Do NOT activate for Laravel Passport (OAuth2 API tokens), Socialite (OAuth social login), or non-auth Laravel features.'
description: 'ACTIVATE when the user works on authentication in Laravel. This includes login, registration, password reset, email verification, two-factor authentication (2FA/TOTP/QR codes/recovery codes), passkeys, profile updates, password confirmation, or any auth-related routes and controllers. Activate when the user mentions Fortify, auth, authentication, login, register, signup, forgot password, verify email, 2FA, passkeys, WebAuthn, or references app/Actions/Fortify/, CreateNewUser, UpdateUserProfileInformation, FortifyServiceProvider, config/fortify.php, or auth guards. Fortify is the frontend-agnostic authentication backend for Laravel that registers all auth routes and controllers. Also activate when building SPA or headless authentication, customizing login redirects, overriding response contracts like LoginResponse, or configuring login throttling. Do NOT activate for Laravel Passport (OAuth2 API tokens), Socialite (OAuth social login), or non-auth Laravel features.'
license: MIT
metadata:
author: laravel
@ -32,6 +32,7 @@ ## Available Features
- `Features::updateProfileInformation()` - Profile updates
- `Features::updatePasswords()` - Password changes
- `Features::twoFactorAuthentication()` - 2FA with QR codes and recovery codes
- `Features::passkeys()` - Passwordless authentication with WebAuthn passkeys
> Use `search-docs` for feature configuration options and customization patterns.
@ -50,6 +51,18 @@ ### Two-Factor Authentication Setup
> Use `search-docs` for TOTP implementation and recovery code handling patterns.
### Passkeys Setup
```
- [ ] Add PasskeyAuthenticatable trait to User model and implement PasskeyUser
- [ ] Enable passkeys feature in config/fortify.php
- [ ] If the passkeys table migration is missing, publish via `php artisan vendor:publish --tag=fortify-migrations` and migrate
- [ ] Configure passkeys relying_party_id, allowed_origins, user_handle_secret, and timeout if defaults are not suitable
- [ ] Build UI with @laravel/passkeys for registration, login, confirmation, and deletion
```
> Use `search-docs` for passkey configuration options. For `@laravel/passkeys` frontend usage, refer to the package's README on npm.
### Email Verification Setup
```
@ -128,4 +141,11 @@ ## Key Endpoints
| Confirm 2FA | POST | `/user/confirmed-two-factor-authentication` |
| 2FA Challenge | POST | `/two-factor-challenge` |
| Get QR Code | GET | `/user/two-factor-qr-code` |
| Recovery Codes | GET/POST | `/user/two-factor-recovery-codes` |
| Recovery Codes | GET/POST | `/user/two-factor-recovery-codes` |
| Passkey Login Options | GET | `/passkeys/login/options` |
| Passkey Login | POST | `/passkeys/login` |
| Passkey Confirm Options| GET | `/passkeys/confirm/options` |
| Passkey Confirm | POST | `/passkeys/confirm` |
| Passkey Options | GET | `/user/passkeys/options` |
| Register Passkey | POST | `/user/passkeys` |
| Delete Passkey | DELETE | `/user/passkeys/{passkey}` |

View file

@ -299,4 +299,4 @@ ## Topic References
- Command entrypoint: `references/command.md`
- With attributes: `references/with-attributes.md`
- Testing and fakes: `references/testing-fakes.md`
- Troubleshooting: `references/troubleshooting.md`
- Troubleshooting: `references/troubleshooting.md`

View file

@ -157,4 +157,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-command.html
- https://www.laravelactions.com/2.x/as-command.html

View file

@ -336,4 +336,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-controller.html
- https://www.laravelactions.com/2.x/as-controller.html

View file

@ -422,4 +422,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-job.html
- https://www.laravelactions.com/2.x/as-job.html

View file

@ -78,4 +78,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-listener.html
- https://www.laravelactions.com/2.x/as-listener.html

View file

@ -115,4 +115,4 @@ ### Dependency injection invocation
return $this->publishArticle->handle($articleId);
}
}
```
```

View file

@ -157,4 +157,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-fake.html
- https://www.laravelactions.com/2.x/as-fake.html

View file

@ -30,4 +30,4 @@ ## Debug checklist
- Reproduce with a focused failing test.
- Validate wiring layer first, then domain behavior.
- Isolate dependencies with fakes/spies where appropriate.
- Isolate dependencies with fakes/spies where appropriate.

View file

@ -186,4 +186,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/with-attributes.html
- https://www.laravelactions.com/2.x/with-attributes.html

View file

@ -94,7 +94,7 @@ ### 8. Testing Patterns → `rules/testing.md`
### 9. Queue & Job Patterns → `rules/queue-jobs.md`
- `retry_after` must exceed job `timeout`; use exponential backoff `[1, 5, 10]`
- `ShouldBeUnique` to prevent duplicates; `WithoutOverlapping::untilProcessing()` for concurrency
- `ShouldBeUnique` to prevent duplicates; `ShouldBeUniqueUntilProcessing` for early lock release
- Always implement `failed()`; with `retryUntil()`, set `$tries = 0`
- `RateLimited` middleware for external API calls; `Bus::batch()` for related jobs
- Horizon for complex multi-queue scenarios
@ -187,4 +187,4 @@ ## How to Apply
1. Identify the file type and select relevant sections (e.g., migration → §16, controller → §1, §3, §5, §6, §10)
2. Check sibling files for existing patterns — follow those first per Consistency First
3. Verify API syntax with `search-docs` for the installed Laravel version
3. Verify API syntax with `search-docs` for the installed Laravel version

View file

@ -103,4 +103,4 @@ ## Use Correlated Subqueries for Has-Many Ordering
->take(1)
);
}
```
```

View file

@ -82,7 +82,7 @@ ## Code to Interfaces
## Default Sort by Descending
When no explicit order is specified, sort by `id` or `created_at` descending. Explicit ordering prevents cross-database inconsistencies between MySQL and Postgres.
When no explicit order is specified, sort by `id` or `created_at` descending. Without an explicit `ORDER BY`, row order is undefined.
Incorrect:
```php
@ -199,4 +199,4 @@ ## Convention Over Configuration
return $this->belongsToMany(Role::class);
}
}
```
```

View file

@ -33,4 +33,4 @@ ## Use Blade Fragments for Partial Re-Renders (htmx/Turbo)
## Use `@aware` for Deeply Nested Component Props
Avoids re-passing parent props through every level of nested components.
Avoids re-passing parent props through every level of nested components.

View file

@ -2,7 +2,7 @@ # Caching Best Practices
## Use `Cache::remember()` Instead of Manual Get/Put
Atomic pattern prevents race conditions and removes boilerplate.
Cleaner cache-aside pattern that removes boilerplate. use `Cache::lock()` for race conditions.
Incorrect:
```php
@ -67,4 +67,4 @@ ## Configure Failover Cache Stores in Production
```php
'failover' => ['driver' => 'failover', 'stores' => ['redis', 'database']],
```
```

View file

@ -41,4 +41,4 @@ ## Use `#[CollectedBy]` for Custom Collection Classes
```php
#[CollectedBy(UserCollection::class)]
class User extends Model {}
```
```

View file

@ -2,7 +2,7 @@ # Configuration Best Practices
## `env()` Only in Config Files
Direct `env()` calls return `null` when config is cached.
Direct `env()` calls may return `null` when config is cached.
Incorrect:
```php
@ -70,4 +70,4 @@ ## Use Constants and Language Files
```php
// Only when lang files already exist in the project
return back()->with('message', __('app.article_added'));
```
```

View file

@ -189,4 +189,4 @@ ## No Queries in Blade Templates
@foreach ($users as $user)
{{ $user->profile->name }}
@endforeach
```
```

View file

@ -145,4 +145,4 @@ ## Avoid Hardcoded Table Names in Queries
Prefer Eloquent queries and relationships over `DB::table()` whenever possible — they already reference the model's table. When `DB::table()` or raw joins are unavoidable, always use `(new Model)->getTable()` to keep the reference traceable.
**Exception — migrations:** In migrations, hardcoded table names via `DB::table('settings')` are acceptable and preferred. Models change over time but migrations are frozen snapshots — referencing a model that is later renamed or deleted would break the migration.
**Exception — migrations:** In migrations, hardcoded table names via `DB::table('settings')` are acceptable and preferred. Models change over time but migrations are frozen snapshots — referencing a model that is later renamed or deleted would break the migration.

View file

@ -69,4 +69,4 @@ ## Add Context to Exception Classes
return ['order_id' => $this->orderId];
}
}
```
```

View file

@ -29,7 +29,11 @@ ## Always Queue Notifications
## Use `afterCommit()` on Notifications in Transactions
Same race condition as events — the queued notification job may run before the transaction commits.
Same race condition as events — call `afterCommit()` to delay dispatch until the transaction commits.
```php
$user->notify((new InvoicePaid($invoice))->afterCommit());
```
## Route Notification Channels to Dedicated Queues
@ -45,4 +49,4 @@ ## Use On-Demand Notifications for Non-User Recipients
## Implement `HasLocalePreference` on Notifiable Models
Laravel automatically uses the user's preferred locale for all notifications and mailables — no per-call `locale()` needed.
Laravel automatically uses the user's preferred locale for all notifications and mailables — no per-call `locale()` needed.

View file

@ -52,7 +52,7 @@ ## Use Retry with Backoff for External APIs
Only retry on specific errors:
```php
$response = Http::retry(3, 100, function (Exception $exception, PendingRequest $request) {
$response = Http::retry(3, 100, function (Throwable $exception, PendingRequest $request) {
return $exception instanceof ConnectionException
|| ($exception instanceof RequestException && $exception->response->serverError());
})->post('https://api.example.com/data');
@ -157,4 +157,4 @@ ## Fake HTTP Calls in Tests
Http::fake([
'api.example.com/*' => Http::failedConnection(),
]);
```
```

View file

@ -10,7 +10,7 @@ ## Use `afterCommit()` on Mailables Inside Transactions
## Use `assertQueued()` Not `assertSent()` for Queued Mailables
`Mail::assertSent()` only catches synchronous mail. Queued mailables silently pass `assertSent`, giving false confidence.
`Mail::assertSent()` only catches synchronous mail. Queued mailables fail `assertSent` with a "Did you mean to use assertQueued()?" hint.
Incorrect: `Mail::assertSent(OrderShipped::class);` when mailable implements `ShouldQueue`.
@ -24,4 +24,4 @@ ## Separate Content Tests from Sending Tests
Content tests: instantiate the mailable directly, call `assertSeeInHtml()`.
Sending tests: use `Mail::fake()` and `assertSent()`/`assertQueued()`.
Don't mix them — it conflates concerns and makes tests brittle.
Don't mix them — it conflates concerns and makes tests brittle.

View file

@ -118,4 +118,4 @@ ## Keep Migrations Focused
// Migration 2: seed_default_settings
DB::table('settings')->insert(['key' => 'version', 'value' => '1.0']);
```
```

View file

@ -106,25 +106,23 @@ ## `retryUntil()` Needs `$tries = 0`
```php
public $tries = 0;
public function retryUntil(): DateTime
public function retryUntil(): \DateTimeInterface
{
return now()->addHours(4);
}
```
## Use `WithoutOverlapping::untilProcessing()`
## Use `ShouldBeUniqueUntilProcessing` for Early Lock Release
Prevents concurrent execution while allowing new instances to queue.
`ShouldBeUnique` holds the lock until the job completes. `ShouldBeUniqueUntilProcessing` releases it when processing starts, allowing new instances to queue.
```php
public function middleware(): array
class UpdateSearchIndex implements ShouldQueue, ShouldBeUniqueUntilProcessing
{
return [new WithoutOverlapping($this->product->id)->untilProcessing()];
// Lock releases when processing begins, not when it finishes
}
```
Without `untilProcessing()`, the lock extends through queue wait time. With it, the lock releases when processing starts.
## Use Horizon for Complex Queue Scenarios
Use Laravel Horizon when you need monitoring, auto-scaling, failure tracking, or multiple queues with different priorities.
@ -143,4 +141,4 @@ ## Use Horizon for Complex Queue Scenarios
],
],
],
```
```

View file

@ -36,7 +36,8 @@ ## Use Resource Controllers
```php
Route::resource('posts', PostController::class);
Route::apiResource('api/posts', Api\PostController::class);
// In routes/api.php — the /api prefix is applied automatically
Route::apiResource('posts', Api\PostController::class);
```
## Keep Controllers Thin
@ -95,4 +96,4 @@ ## Type-Hint Form Requests
return redirect()->route('posts.index');
}
```
```

View file

@ -36,4 +36,4 @@ ## Use Schedule Groups for Shared Configuration
Schedule::command('emails:send --force');
Schedule::command('emails:prune');
});
```
```

View file

@ -32,7 +32,7 @@ ## Authorize Every Action
Incorrect:
```php
public function update(Request $request, Post $post)
public function update(UpdatePostRequest $request, Post $post)
{
$post->update($request->validated());
}
@ -90,7 +90,7 @@ ## Escape Output to Prevent XSS
## CSRF Protection
Include `@csrf` in all POST/PUT/DELETE Blade forms. Not needed in Inertia.
Include `@csrf` in all POST/PUT/DELETE Blade forms. In Inertia apps, the `@csrf` directive is automatically applied.
Incorrect:
```blade
@ -121,7 +121,7 @@ ## Rate Limit Auth and API Routes
## Validate File Uploads
Validate MIME type, extension, and size. Never trust client-provided filenames.
Validate extension, MIME type, and size. The `mimes` rule checks extensions; use `mimetypes` for actual MIME type validation. Never trust client-provided filenames.
```php
public function rules(): array
@ -195,4 +195,4 @@ ## Encrypt Sensitive Database Fields
];
}
}
```
```

View file

@ -2,7 +2,7 @@ # Testing Best Practices
## Use `LazilyRefreshDatabase` Over `RefreshDatabase`
`RefreshDatabase` runs all migrations every test run even when the schema hasn't changed. `LazilyRefreshDatabase` only migrates when needed, significantly speeding up large suites.
`RefreshDatabase` migrates once per process and wraps each test in a rolled-back transaction. `LazilyRefreshDatabase` skips even that first migration if the schema is already up to date.
## Use Model Assertions Over Raw Database Assertions
@ -40,4 +40,4 @@ ## Use `recycle()` to Share Relationship Instances Across Factories
Ticket::factory()
->recycle(Airline::factory()->create())
->create();
```
```

View file

@ -72,4 +72,4 @@ ## Use the `after()` Method for Custom Validation
},
];
}
```
```

View file

@ -112,4 +112,4 @@ ## Common Pitfalls
- Forgetting `wire:key` in loops causes unexpected behavior when items change
- Using `wire:model` expecting real-time updates (use `wire:model.live` instead in v3)
- Not validating/authorizing in Livewire actions (treat them like HTTP requests)
- Including Alpine.js separately when it's already bundled with Livewire 3
- Including Alpine.js separately when it's already bundled with Livewire 3

View file

@ -0,0 +1,96 @@
---
name: mcp-development
description: "Use this skill for Laravel MCP development only. Trigger when creating or editing MCP tools, resources, prompts, or servers in Laravel projects. Covers: artisan make:mcp-* generators, mcp:inspector, routes/ai.php, Tool/Resource/Prompt classes, schema validation, shouldRegister(), OAuth setup, URI templates, read-only attributes, and MCP debugging. Do not use for non-Laravel MCP projects or generic AI features without MCP."
license: MIT
metadata:
author: laravel
---
# MCP Development
## Documentation
Use `search-docs` for detailed Laravel MCP patterns and documentation.
## Basic Usage
Register MCP servers in `routes/ai.php`:
<!-- Register MCP Server -->
```php
use Laravel\Mcp\Facades\Mcp;
Mcp::web();
```
### Creating MCP Primitives
Create MCP tools, resources, prompts, and servers using artisan commands:
```bash
php artisan make:mcp-tool ToolName # Create a tool
php artisan make:mcp-resource ResourceName # Create a resource
php artisan make:mcp-prompt PromptName # Create a prompt
php artisan make:mcp-server ServerName # Create a server
```
After creating primitives, register them in your server's `$tools`, `$resources`, or `$prompts` properties.
### Tools
<!-- MCP Tool Example -->
```php
use Laravel\Mcp\Server\Tool;
use Laravel\Mcp\Server\Request;
use Laravel\Mcp\Server\Response;
class MyTool extends Tool
{
public function handle(Request $request): Response
{
return new Response(['result' => 'success']);
}
}
```
### Registering Primitives in a Server
Each MCP server must explicitly declare the tools, resources, and prompts it exposes.
<!-- Register Primitives in MCP Server -->
```php
use Laravel\Mcp\Server;
class AppServer extends Server
{
protected array $tools = [
\App\Mcp\Tools\MyTool::class,
];
protected array $resources = [
\App\Mcp\Resources\MyResource::class,
];
protected array $prompts = [
\App\Mcp\Prompts\MyPrompt::class,
];
}
```
## Verification
1. Check `routes/ai.php` for proper registration
2. Test tool via MCP client
## Common Pitfalls
- Running `mcp:start` command (it hangs waiting for input)
- Using HTTPS locally with Node-based MCP clients
- Not using `search-docs` for the latest MCP documentation
- Not registering MCP server routes in `routes/ai.php`
- Do not register `ai.php` in `bootstrap.php`; it is registered automatically.
- OAuth registration supports custom URI schemes (e.g., `cursor://`, `vscode://`) for native desktop clients via `mcp.custom_schemes` config

View file

@ -1,6 +1,6 @@
---
name: pest-testing
description: "Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to write something in Pest, mentions test files or directories (tests/Feature, tests/Unit, tests/Browser), or needs browser testing, smoke testing multiple pages for JS errors, or architecture tests. Covers: it()/expect() syntax, datasets, mocking, browser testing (visit/click/fill), smoke testing, arch(), Livewire component tests, RefreshDatabase, and all Pest 4 features. Do not use for factories, seeders, migrations, controllers, models, or non-test PHP code."
description: "Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to write something in Pest, mentions test files or directories (tests/Feature, tests/Unit, tests/Browser), or needs browser testing, smoke testing multiple pages for JS errors, or architecture tests. Covers: test()/it()/expect() syntax, datasets, mocking, browser testing (visit/click/fill), smoke testing, arch(), Livewire component tests, RefreshDatabase, and all Pest 4 features. Do not use for factories, seeders, migrations, controllers, models, or non-test PHP code."
license: MIT
metadata:
author: laravel
@ -18,6 +18,12 @@ ### Creating Tests
All tests must be written using Pest. Use `php artisan make:test --pest {name}`.
The `{name}` argument should include only the path and test name, but should not include the test suite.
- Incorrect: `php artisan make:test --pest Feature/SomeFeatureTest` will generate `tests/Feature/Feature/SomeFeatureTest.php`
- Correct: `php artisan make:test --pest SomeControllerTest` will generate `tests/Feature/SomeControllerTest.php`
- Incorrect: `php artisan make:test --pest --unit Unit/SomeServiceTest` will generate `tests/Unit/Unit/SomeServiceTest.php`
- Correct: `php artisan make:test --pest --unit SomeServiceTest` will generate `tests/Unit/SomeServiceTest.php`
### Test Organization
- Unit/Feature tests: `tests/Feature` and `tests/Unit` directories.
@ -26,6 +32,8 @@ ### Test Organization
### Basic Test Structure
Pest supports both `test()` and `it()` functions. Before writing new tests, check existing test files in the same directory to match the project's convention. Use `test()` if existing tests use `test()`, or `it()` if they use `it()`.
<!-- Basic Pest Test Example -->
```php
it('is true', function () {
@ -154,4 +162,5 @@ ## Common Pitfalls
- Using `assertStatus(200)` instead of `assertSuccessful()`
- Forgetting datasets for repetitive validation tests
- Deleting tests without approval
- Forgetting `assertNoJavaScriptErrors()` in browser tests
- Forgetting `assertNoJavaScriptErrors()` in browser tests
- Prefixing `Feature/` or `Unit/` in `{name}` when using `make:test`

View file

@ -77,4 +77,4 @@ ## Common Pitfalls
- Redirect URL in `config/services.php` must exactly match the provider's OAuth dashboard (including trailing slashes and protocol).
- Do not pass `state`, `response_type`, `client_id`, `redirect_uri`, or `scope` via `with()` — these are reserved.
- Community providers require event listener registration via `SocialiteWasCalled`.
- `user()` throws when the user declines authorization. Always handle denied grants.
- `user()` throws when the user declines authorization. Always handle denied grants.

View file

@ -116,4 +116,4 @@ ## Common Pitfalls
- Using `@tailwind` directives instead of `@import "tailwindcss"`
- Trying to use `tailwind.config.js` instead of CSS `@theme` directive
- Using margins for spacing between siblings instead of gap utilities
- Forgetting to add dark mode variants when the project uses dark mode
- Forgetting to add dark mode variants when the project uses dark mode

View file

@ -0,0 +1,404 @@
---
name: configure-nightwatch
description: Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies. Use when setting up Nightwatch, managing data volume, protecting sensitive data (PII), or optimizing event collection for production workloads.
license: MIT
metadata:
author: laravel
---
# Nightwatch Configuration Guide
This skill helps configure Laravel Nightwatch data collection to balance observability, performance, and privacy. Covers sampling strategies, filtering rules, and redaction methods across all event types.
## Documentation Reference
The [Nightwatch Documentation](https://nightwatch.laravel.com/docs) is the definitive and up-to-date source of information for all Nightwatch configuration options. This skill provides practical guidance and common patterns, but always consult the official documentation as the primary source of truth for specific details, environment variables, and API behavior. The documentation includes comprehensive coverage of:
- [Filtering and Configuration](https://nightwatch.laravel.com/docs/filtering) - Core concepts for sampling, filtering, and redaction
- Individual event type pages with specific configuration options:
- [Requests](https://nightwatch.laravel.com/docs/requests) - Request sampling, header handling, payload capture
- [Commands](https://nightwatch.laravel.com/docs/commands) - Command sampling and redaction
- [Queries](https://nightwatch.laravel.com/docs/queries) - Query filtering and redaction
- [Cache](https://nightwatch.laravel.com/docs/cache) - Cache event filtering by key or pattern
- [Jobs](https://nightwatch.laravel.com/docs/jobs) - Job filtering and sampling decoupling
- [Mail](https://nightwatch.laravel.com/docs/mail) - Mail event filtering
- [Notifications](https://nightwatch.laravel.com/docs/notifications) - Notification filtering by channel
- [Exceptions](https://nightwatch.laravel.com/docs/exceptions) - Exception sampling and throttling
- [Outgoing Requests](https://nightwatch.laravel.com/docs/outgoing-requests) - HTTP request filtering
- [reference.md](reference.md) - Quick lookup table by event type, production presets, and verification checklist
## Data Collection Flow
Nightwatch processes events through three stages:
1. **Sampling** - Controls which entry points are captured (requests, commands, scheduled tasks)
2. **Filtering** - Excludes specific events after sampling (queries, cache, mail, etc.)
3. **Redaction** - Modifies captured data to remove/obfuscate sensitive information
```
Request/Command/Scheduled Task
|
v
[Sampling?] ----NO----> Drop entire trace
| YES
v
Events generated
|
v
[Filtering?] ----YES---> Drop specific event
| NO
v
[Redaction] ----------> Store modified data
```
---
## Sampling Configuration
Sampling determines which entry points (requests, commands, scheduled tasks) trigger full trace collection. When an entry point is sampled, all related events are captured.
### Global Sample Rates
Configure via environment variables:
```bash
# Default: 100% sampling (all requests/commands captured)
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.1 # Recommended: 10% of requests
NIGHTWATCH_COMMAND_SAMPLE_RATE=1.0 # Capture all commands
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0 # Always capture exceptions
```
**Recommendation**: Start with `0.1` (10%) for requests in production, adjust based on volume and needs.
### Route-Based Sampling
Apply different rates to specific routes using the `Sample` middleware:
```php routes/web.php
use Illuminate\Support\Facades\Route;
use Laravel\Nightwatch\Http\Middleware\Sample;
// Sample admin routes at 100%
Route::middleware(Sample::rate(1.0))->prefix('admin')->group(function () {
// All admin routes sampled fully
});
// Sample API routes at 5%
Route::middleware(Sample::rate(0.05))->prefix('api')->group(function () {
// API routes sampled sparingly
});
// Always sample critical endpoints
Route::post('/checkout', [CheckoutController::class, 'process'])
->middleware(Sample::always());
// Never sample health checks
Route::get('/health', [HealthController::class, 'check'])
->middleware(Sample::never());
```
### Unmatched Route Sampling
Handle 404/bot traffic with reduced sampling:
```php routes/web.php
Route::fallback(fn () => abort(404))
->middleware(Sample::rate(0.01)); // 1% sampling for unmatched routes
```
### Dynamic Sampling
Sample based on runtime conditions (user role, request attributes):
```php app/Http/Middleware/SampleAdminRequests.php
use Closure;
use Illuminate\Http\Request;
use Laravel\Nightwatch\Facades\Nightwatch;
class SampleAdminRequests
{
public function handle(Request $request, Closure $next)
{
if ($request->user()?->isAdmin()) {
Nightwatch::sample(); // Always sample admin requests
}
return $next($request);
}
}
```
### Command Sampling
Exclude specific commands from sampling:
```php AppServiceProvider.php
use Illuminate\Console\Events\CommandStarting;
use Illuminate\Support\Facades\Event;
use Laravel\Nightwatch\Facades\Nightwatch;
public function boot(): void
{
Event::listen(function (CommandStarting $event) {
if (in_array($event->command, ['schedule:finish', 'horizon:snapshot'])) {
Nightwatch::dontSample();
}
});
}
```
### Vendor Commands
Nightwatch automatically ignores framework/internal commands. Opt-in to capture them:
```php
Nightwatch::captureDefaultVendorCommands();
```
---
## Filtering Configuration
Filtering excludes specific events from collection after sampling. Use filtering to reduce noise and quota usage.
### Database Queries
**Filter all queries** (disable query collection):
```bash
NIGHTWATCH_IGNORE_QUERIES=true
```
**Filter specific queries** by SQL pattern:
```php AppServiceProvider.php
use Laravel\Nightwatch\Facades\Nightwatch;
use Laravel\Nightwatch\Records\Query;
public function boot(): void
{
// Filter job table queries (PostgreSQL)
Nightwatch::rejectQueries(function (Query $query) {
return str_contains($query->sql, 'into "jobs"');
});
// Filter cache table queries (MySQL)
Nightwatch::rejectQueries(function (Query $query) {
return str_contains($query->sql, 'from `cache`')
|| str_contains($query->sql, 'into `cache`');
});
}
```
### Cache Events
**Filter all cache events**:
```bash
NIGHTWATCH_IGNORE_CACHE_EVENTS=true
```
**Filter by cache key patterns**:
```php
Nightwatch::rejectCacheKeys([
'my-app:users', // Exact match
'/^my-app:posts:/', // Regex: starts with my-app:posts:
'/^[a-zA-Z0-9]{40}$/', // Regex: session IDs
]);
```
**Filter with callback**:
```php
use Laravel\Nightwatch\Records\CacheEvent;
Nightwatch::rejectCacheEvents(function (CacheEvent $cacheEvent) {
return str_starts_with($cacheEvent->key, 'temp:');
});
```
### Mail Events
**Filter all mail**:
```bash
NIGHTWATCH_IGNORE_MAIL=true
```
**Filter specific mail**:
```php
use Laravel\Nightwatch\Records\Mail;
Nightwatch::rejectMail(function (Mail $mail) {
return str_contains($mail->subject, 'Newsletter');
});
```
### Notification Events
**Filter all notifications**:
```bash
NIGHTWATCH_IGNORE_NOTIFICATIONS=true
```
**Filter by channel**:
```php
use Laravel\Nightwatch\Records\Notification;
Nightwatch::rejectNotifications(function (Notification $notification) {
return $notification->channel === 'database';
});
```
### Outgoing HTTP Requests
**Filter all outgoing requests**:
```bash
NIGHTWATCH_IGNORE_OUTGOING_REQUESTS=true
```
**Filter by URL**:
```php
use Laravel\Nightwatch\Records\OutgoingRequest;
Nightwatch::rejectOutgoingRequests(function (OutgoingRequest $request) {
return str_contains($request->url, 'analytics.example.com');
});
```
### Queued Jobs
**Filter specific jobs**:
```php
use Laravel\Nightwatch\Records\QueuedJob;
Nightwatch::rejectQueuedJobs(function (QueuedJob $job) {
return $job->name === 'App\Jobs\LowPriorityJob';
});
```
### Decoupling Job Sampling
Sample jobs independently from parent contexts:
```php
use Illuminate\Support\Facades\Queue;
public function boot(): void
{
Queue::before(fn () => Nightwatch::sample(rate: 0.5));
}
```
---
## Redaction Configuration
Redaction modifies captured data to remove or obfuscate sensitive information. Unlike filtering, redaction keeps the event but sanitizes its content.
### Request Redaction
**Redact sensitive headers** (automatically redacts: Authorization, Cookie, X-XSRF-TOKEN):
```bash
# Customize redacted headers
NIGHTWATCH_REDACT_HEADERS=Authorization,Cookie,Proxy-Authorization,X-API-Key
```
**Redact request payloads** (disabled by default):
```bash
# Enable payload capture
NIGHTWATCH_CAPTURE_REQUEST_PAYLOAD=true
# Customize redacted fields
NIGHTWATCH_REDACT_PAYLOAD_FIELDS=password,password_confirmation,ssn,credit_card
```
**Programmatic redaction**:
```php
use Laravel\Nightwatch\Facades\Nightwatch;
use Laravel\Nightwatch\Records\Request;
Nightwatch::redactRequests(function (Request $request) {
$request->url = str_replace('secret', '***', $request->url);
$request->ip = preg_replace('/\d+$/', '***', $request->ip);
});
```
### Query Redaction
```php
use Laravel\Nightwatch\Records\Query;
Nightwatch::redactQueries(function (Query $query) {
$query->sql = str_replace('secret_token', '***', $query->sql);
});
```
### Cache Redaction
```php
use Laravel\Nightwatch\Records\CacheEvent;
Nightwatch::redactCacheEvents(function (CacheEvent $cacheEvent) {
$cacheEvent->key = str_replace('user:', 'user:***:', $cacheEvent->key);
});
```
### Command Redaction
```php
use Laravel\Nightwatch\Records\Command;
Nightwatch::redactCommands(function (Command $command) {
$command->command = preg_replace('/--password=\S+/', '--password=***', $command->command);
});
```
### Exception Redaction
```php
use Laravel\Nightwatch\Records\Exception;
Nightwatch::redactExceptions(function (Exception $exception) {
$exception->message = str_replace('secret', '***', $exception->message);
});
```
### Mail Redaction
```php
use Laravel\Nightwatch\Records\Mail;
Nightwatch::redactMail(function (Mail $mail) {
$mail->subject = str_replace('Invoice #', 'Invoice ***', $mail->subject);
});
```
### Outgoing Request Redaction
```php
use Laravel\Nightwatch\Records\OutgoingRequest;
Nightwatch::redactOutgoingRequests(function (OutgoingRequest $outgoingRequest) {
$outgoingRequest->url = preg_replace('/api_key=\w+/', 'api_key=***', $outgoingRequest->url);
});
```

View file

@ -0,0 +1,108 @@
# Nightwatch Configuration Reference
## Configuration Summary by Event Type
| Event Type | Sampling | Filtering | Redaction |
| --------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------- |
| **Requests** | `NIGHTWATCH_REQUEST_SAMPLE_RATE`, Route middleware | Not applicable | Headers, payload, URL, IP |
| **Commands** | `NIGHTWATCH_COMMAND_SAMPLE_RATE`, Event listener | Not applicable | Command arguments |
| **Queries** | Parent context | `rejectQueries()`, `NIGHTWATCH_IGNORE_QUERIES` | SQL statement |
| **Cache** | Parent context | `rejectCacheKeys()`, `rejectCacheEvents()`, `NIGHTWATCH_IGNORE_CACHE_EVENTS` | Cache key |
| **Jobs** | Parent context, Queue::before | `rejectQueuedJobs()` | Not applicable |
| **Mail** | Parent context | `rejectMail()`, `NIGHTWATCH_IGNORE_MAIL` | Subject |
| **Notifications** | Parent context | `rejectNotifications()`, `NIGHTWATCH_IGNORE_NOTIFICATIONS` | Not applicable |
| **Outgoing Requests** | Parent context | `rejectOutgoingRequests()`, `NIGHTWATCH_IGNORE_OUTGOING_REQUESTS` | URL |
| **Exceptions** | `NIGHTWATCH_EXCEPTION_SAMPLE_RATE` | Not applicable | Exception message |
---
## Production Recommendations
### High-Traffic Applications
```bash
# Conservative sampling
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.01 # 1% of requests
NIGHTWATCH_COMMAND_SAMPLE_RATE=0.1 # 10% of commands
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0 # Always capture exceptions
# Filter noisy events
NIGHTWATCH_IGNORE_CACHE_EVENTS=true
NIGHTWATCH_IGNORE_QUERIES=true # Or filter specific queries programmatically
```
### Privacy-Conscious Applications
```bash
# Disable sensitive data collection
NIGHTWATCH_CAPTURE_REQUEST_PAYLOAD=false
NIGHTWATCH_REDACT_HEADERS=Authorization,Cookie,Proxy-Authorization,X-XSRF-TOKEN
# Or use redaction in AppServiceProvider
```
### Balanced Configuration (Recommended Start)
```bash
# Sample rates
NIGHTWATCH_REQUEST_SAMPLE_RATE=0.1
NIGHTWATCH_COMMAND_SAMPLE_RATE=1.0
NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0
# Filter obvious noise programmatically
# Redact PII as needed
```
---
## Verification Checklist
After configuration:
- [ ] Sampling rates appropriate for traffic volume
- [ ] Noisy events filtered (cache, certain queries)
- [ ] Sensitive data redacted (PII, tokens, credentials)
- [ ] Exceptions always captured for debugging
- [ ] Test in development with `NIGHTWATCH_REQUEST_SAMPLE_RATE=1.0`
- [ ] Monitor event quota usage in Nightwatch dashboard
---
## Common Patterns
### Filter Health Checks + Reduce Sampling
```php
Route::get('/health', fn() => ['status' => 'ok'])
->middleware(Sample::never());
```
### Exclude Internal/Vendor Queries
```php
Nightwatch::rejectQueries(fn($q) =>
str_contains($q->sql, 'telescope') ||
str_contains($q->sql, 'pulse')
);
```
### Protect User Data in Cache Keys
```php
Nightwatch::redactCacheEvents(fn($e) =>
$e->key = preg_replace('/user:\d+/', 'user:***', $e->key)
);
```

View file

@ -82,4 +82,4 @@ ## Common Pitfalls
- The `environments` array overrides only the keys you specify. It merges into `defaults` and does not replace it.
- The timeout chain must be ordered: job `timeout` less than supervisor `timeout` less than `retry_after`. The wrong order can cause jobs to be retried before Horizon finishes timing them out.
- The metrics dashboard stays blank until `horizon:snapshot` is scheduled. Running `php artisan horizon` alone does not populate metrics.
- Always use `search-docs` for the latest Horizon documentation rather than relying on this skill alone.
- Always use `search-docs` for the latest Horizon documentation rather than relying on this skill alone.

View file

@ -18,4 +18,4 @@ ### Register the snapshot in the scheduler rather than running it manually
### `metrics.trim_snapshots` is a snapshot count, not a time duration
The `trim_snapshots.job` and `trim_snapshots.queue` values in `config/horizon.php` are counts of snapshots to keep, not minutes or hours. With the default of 24 snapshots at 5-minute intervals, that provides 2 hours of history. Increase the value to retain more history at the cost of Redis memory usage.
The `trim_snapshots.job` and `trim_snapshots.queue` values in `config/horizon.php` are counts of snapshots to keep, not minutes or hours. With the default of 24 snapshots at 5-minute intervals, that provides 2 hours of history. Increase the value to retain more history at the cost of Redis memory usage.

View file

@ -18,4 +18,4 @@ ### Use Horizon's built-in notification routing in `HorizonServiceProvider`
### Failed job alerts are separate from Horizon's documented notification routing
Horizon's 12.x documentation covers built-in long-wait notifications. Do not assume the docs provide a `JobFailed` listener example in `HorizonServiceProvider`. If a user needs failed job alerts, treat that as custom queue event handling and consult the queue documentation instead of Horizon's notification-routing API.
Horizon's 12.x documentation covers built-in long-wait notifications. Do not assume the docs provide a `JobFailed` listener example in `HorizonServiceProvider`. If a user needs failed job alerts, treat that as custom queue event handling and consult the queue documentation instead of Horizon's notification-routing API.

View file

@ -24,4 +24,4 @@ ### Use `balance: false` to keep a fixed number of workers on a dedicated queue
### Set `balanceCooldown` to prevent rapid worker scaling under bursty load
When using `balance: auto`, the supervisor can scale up and down rapidly under bursty load. Set `balanceCooldown` to the number of seconds between scaling decisions, typically 3 to 5, to smooth this out. `balanceMaxShift` limits how many processes are added or removed per cycle.
When using `balance: auto`, the supervisor can scale up and down rapidly under bursty load. Set `balanceCooldown` to the number of seconds between scaling decisions, typically 3 to 5, to smooth this out. `balanceMaxShift` limits how many processes are added or removed per cycle.

View file

@ -18,4 +18,4 @@ ### `silenced` hides jobs from the dashboard completed list but does not stop th
### `silenced_tags` hides all jobs carrying a matching tag from the completed list
Any job carrying a matching tag string is hidden from the completed jobs view. This is useful for silencing a category of jobs such as all jobs tagged `notifications`, rather than silencing specific classes.
Any job carrying a matching tag string is hidden from the completed jobs view. This is useful for silencing a category of jobs such as all jobs tagged `notifications`, rather than silencing specific classes.

View file

@ -411,4 +411,4 @@ ## Payload Type Reference
| `remove` | (empty) | Remove entry |
| `confetti` | (empty) | Confetti animation |
| `show_app` | (empty) | Show Ray window |
| `hide_app` | (empty) | Hide Ray window |
| `hide_app` | (empty) | Hide Ray window |

View file

@ -1,6 +1,6 @@
---
name: fortify-development
description: 'ACTIVATE when the user works on authentication in Laravel. This includes login, registration, password reset, email verification, two-factor authentication (2FA/TOTP/QR codes/recovery codes), profile updates, password confirmation, or any auth-related routes and controllers. Activate when the user mentions Fortify, auth, authentication, login, register, signup, forgot password, verify email, 2FA, or references app/Actions/Fortify/, CreateNewUser, UpdateUserProfileInformation, FortifyServiceProvider, config/fortify.php, or auth guards. Fortify is the frontend-agnostic authentication backend for Laravel that registers all auth routes and controllers. Also activate when building SPA or headless authentication, customizing login redirects, overriding response contracts like LoginResponse, or configuring login throttling. Do NOT activate for Laravel Passport (OAuth2 API tokens), Socialite (OAuth social login), or non-auth Laravel features.'
description: 'ACTIVATE when the user works on authentication in Laravel. This includes login, registration, password reset, email verification, two-factor authentication (2FA/TOTP/QR codes/recovery codes), passkeys, profile updates, password confirmation, or any auth-related routes and controllers. Activate when the user mentions Fortify, auth, authentication, login, register, signup, forgot password, verify email, 2FA, passkeys, WebAuthn, or references app/Actions/Fortify/, CreateNewUser, UpdateUserProfileInformation, FortifyServiceProvider, config/fortify.php, or auth guards. Fortify is the frontend-agnostic authentication backend for Laravel that registers all auth routes and controllers. Also activate when building SPA or headless authentication, customizing login redirects, overriding response contracts like LoginResponse, or configuring login throttling. Do NOT activate for Laravel Passport (OAuth2 API tokens), Socialite (OAuth social login), or non-auth Laravel features.'
license: MIT
metadata:
author: laravel
@ -32,6 +32,7 @@ ## Available Features
- `Features::updateProfileInformation()` - Profile updates
- `Features::updatePasswords()` - Password changes
- `Features::twoFactorAuthentication()` - 2FA with QR codes and recovery codes
- `Features::passkeys()` - Passwordless authentication with WebAuthn passkeys
> Use `search-docs` for feature configuration options and customization patterns.
@ -50,6 +51,18 @@ ### Two-Factor Authentication Setup
> Use `search-docs` for TOTP implementation and recovery code handling patterns.
### Passkeys Setup
```
- [ ] Add PasskeyAuthenticatable trait to User model and implement PasskeyUser
- [ ] Enable passkeys feature in config/fortify.php
- [ ] If the passkeys table migration is missing, publish via `php artisan vendor:publish --tag=fortify-migrations` and migrate
- [ ] Configure passkeys relying_party_id, allowed_origins, user_handle_secret, and timeout if defaults are not suitable
- [ ] Build UI with @laravel/passkeys for registration, login, confirmation, and deletion
```
> Use `search-docs` for passkey configuration options. For `@laravel/passkeys` frontend usage, refer to the package's README on npm.
### Email Verification Setup
```
@ -128,4 +141,11 @@ ## Key Endpoints
| Confirm 2FA | POST | `/user/confirmed-two-factor-authentication` |
| 2FA Challenge | POST | `/two-factor-challenge` |
| Get QR Code | GET | `/user/two-factor-qr-code` |
| Recovery Codes | GET/POST | `/user/two-factor-recovery-codes` |
| Recovery Codes | GET/POST | `/user/two-factor-recovery-codes` |
| Passkey Login Options | GET | `/passkeys/login/options` |
| Passkey Login | POST | `/passkeys/login` |
| Passkey Confirm Options| GET | `/passkeys/confirm/options` |
| Passkey Confirm | POST | `/passkeys/confirm` |
| Passkey Options | GET | `/user/passkeys/options` |
| Register Passkey | POST | `/user/passkeys` |
| Delete Passkey | DELETE | `/user/passkeys/{passkey}` |

View file

@ -299,4 +299,4 @@ ## Topic References
- Command entrypoint: `references/command.md`
- With attributes: `references/with-attributes.md`
- Testing and fakes: `references/testing-fakes.md`
- Troubleshooting: `references/troubleshooting.md`
- Troubleshooting: `references/troubleshooting.md`

View file

@ -157,4 +157,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-command.html
- https://www.laravelactions.com/2.x/as-command.html

View file

@ -336,4 +336,4 @@ ## Common pitfalls
## References
- https://www.laravelactions.com/2.x/as-controller.html
- https://www.laravelactions.com/2.x/as-controller.html

Some files were not shown because too many files have changed in this diff Show more