8 Commits
Author SHA1 Message Date
mathiaspalmqvist a97baf5921 Accept text/plain events from the Plausible tracker
dependabot-auto-merge / dependabot (pull_request_target) Skipped
Fix PHP code style issues / php-code-styling (push) Successful in 6s
PHPStan / phpstan (push) Successful in 2m38s
run-tests / P8.3 - L11.* - prefer-lowest - ubuntu-latest (push) Failing after 33s
run-tests / P8.4 - L11.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L11.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L12.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L12.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L12.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L12.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L13.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L13.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L13.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L13.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L11.* - prefer-stable - ubuntu-latest (push) Canceled after 1s
The Plausible tracker posts its JSON payload with Content-Type text/plain,
  which Laravel does not parse, so every real event failed validation and
  was redirected instead of being forwarded.

  - Decode the raw body when the request is not JSON
  - Respond with 400 instead of a redirect on invalid non-JSON requests
  - Trim trailing slash from the configured domain when forwarding events
  - Add a 5s timeout and respond with 502 when Plausible is unreachable
2026-11-12 09:18:50 +01:00
mathiaspalmqvist 513ceb61a0 Support custom Plausible script path
dependabot-auto-merge / dependabot (pull_request_target) Skipped
Fix PHP code style issues / php-code-styling (push) Successful in 6s
PHPStan / phpstan (push) Successful in 2m32s
run-tests / P8.3 - L11.* - prefer-lowest - ubuntu-latest (push) Failing after 34s
run-tests / P8.4 - L11.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L11.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L12.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L12.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L12.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L12.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L11.* - prefer-stable - ubuntu-latest (push) Canceled after 2s
Add a PLAUSIBLE_SCRIPT config option so site-specific scripts
(js/pa-XXXXX.js) and legacy script extensions can be proxied. The
script is still served locally from /js/script.js and the cache key
is derived from the script URL so changing the script takes effect
immediately.

Closes #14
2026-11-12 08:27:43 +01:00
mathiaspalmqvist a60e4cbdcf Rename package to mattitja/laravel-plausible-proxy
dependabot-auto-merge / dependabot (pull_request_target) Skipped
PHPStan / phpstan (push) Successful in 2m32s
run-tests / P8.3 - L11.* - prefer-lowest - ubuntu-latest (push) Failing after 34s
Fix PHP code style issues / php-code-styling (push) Successful in 6s
run-tests / P8.4 - L11.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L11.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L12.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L12.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L12.* - prefer-lowest - ubuntu-latest (push) Canceled after 0s
run-tests / P8.4 - L12.* - prefer-stable - ubuntu-latest (push) Canceled after 0s
run-tests / P8.3 - L11.* - prefer-stable - ubuntu-latest (push) Canceled after 2s
- Rename Composer package to mattitja/laravel-plausible-proxy and
  namespace to Mattitja\LaravelPlausibleProxy
- Point homepage and links to git.mattitja.se
- Forward only User-Agent and visitor IP (X-Forwarded-For) to Plausible
  instead of all request headers
- Forward all event fields and return Plausible's upstream response
- Accept props as array or JSON string
- Drop Laravel 10, upgrade Larastan to 3 and PHPStan plugins to 2
- Remove broken facade alias and dead autoload paths
- Clean up README, issue template and remove invalid FUNDING.yml
2026-11-12 08:24:45 +01:00
mathiaspalmqvist 15e9fcc186 Clean 2025-06-25 21:21:07 +02:00
mathiaspalmqvist a2c3ad76c0 Added support for 8.3 2025-01-31 13:10:39 +01:00
mathiaspalmqvist 164c3ab5dd Fix styling 2025-01-31 11:36:31 +00:00
mathiaspalmqvist 26454a9501 Refactor event forwarding and improve test coverage
- Updated event forwarding to include request headers
- Refactored validation to improve error handling
- Fixed issue with missing headers in HTTP request
- Improved test cases for event forwarding and caching
- Ensured proper handling of JSON payloads
- Fixed Plausible API URL configuration in tests
2025-01-31 12:36:07 +01:00
mathiaspalmqvist f7e5575cfa first release 2025-01-30 23:44:18 +01:00