Skip to content

feat: add Laravel middleware composer package#104

Open
emptyteabot wants to merge 1 commit into
aporthq:mainfrom
emptyteabot:laravel-middleware-package-15-clean
Open

feat: add Laravel middleware composer package#104
emptyteabot wants to merge 1 commit into
aporthq:mainfrom
emptyteabot:laravel-middleware-package-15-clean

Conversation

@emptyteabot
Copy link
Copy Markdown

@emptyteabot emptyteabot commented May 14, 2026

Summary

  • Add a Laravel Composer package template under templates/laravel-middleware.
  • Include aport.policy route middleware, an APort HTTP client, config publishing, and an aport:policy Artisan command.
  • Add a minimal Laravel refund route/controller example plus Testbench/PHPUnit coverage for allow, deny, missing agent id, client error, and fail-open paths.
  • Normalize APort denial reasons, preserve agent/policy request attributes on fail-open, and guard custom context merging against invalid attribute values.
  • Update the root README to list the Laravel template as active.

Verification

  • composer install --no-interaction --prefer-dist
  • php vendor/bin/phpunit - 9 tests, 19 assertions passing
  • composer validate --strict
  • php -l across all package PHP files
  • git diff --check

Closes #15

Payout address: 0xe2e86bdb8753c24032f2ad42b4c1bd9748385a7d

@emptyteabot emptyteabot force-pushed the laravel-middleware-package-15-clean branch from 3d4f8f5 to 9ae3cbd Compare May 15, 2026 07:40
@emptyteabot
Copy link
Copy Markdown
Author

emptyteabot commented May 15, 2026

Fresh local verification completed for the Laravel middleware package.

Commands run from templates/laravel-middleware:

  • composer install --no-interaction --no-progress --prefer-dist
  • composer test -> 9 tests passed, 19 assertions

No live APort API key or external API call was required; tests use Laravel HTTP fakes.

@emptyteabot
Copy link
Copy Markdown
Author

Gentle follow-up: this PR is still mergeable and the Laravel middleware package verification passes locally (composer test -> 9 tests, 19 assertions). Happy to adjust anything needed for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Hacktoberfest] Laravel Middleware Package

1 participant