Skip to content

feat(laravel): route middleware, facade test assertions; README for Laravel users - #2

Merged
roncohen merged 1 commit into
mainfrom
docs/laravel-native-readme
Dec 3, 2026
Merged

roncohen merged 1 commit into
mainfrom
docs/laravel-native-readme

Conversation

@roncohen

@roncohen roncohen commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Fixes from a review of the README for anything that doesn't feel Laravel-native.

Code

  • EnsureFlagsAreEnabled route middleware, aliased as reflag: ->middleware('reflag:new-dashboard') or EnsureFlagsAreEnabled::using('a', 'b'). Responds 404 unless every flag resolves to true.
  • The Reflag facade docblock lists the fake's assertions, so Reflag::assertFlagChecked() works in IDEs, matching Event::fake() / Event::assertDispatched().

README

  • Laravel-first order; plain PHP and the example app moved to the end, flag types next to reading flags.
  • Pest test example using facade assertions; added missing use imports and the undefined $user.
  • Inertia share() example alongside the Blade bootstrap.
  • Supervisor config for reflag:listen (verified: SIGTERM drains telemetry and exits 0), onOneServer() in the schedule, and a table of Artisan commands.
  • Accuracy: "never calls Reflag" instead of "no network round trip"; a note that php artisan serve waits for telemetry; the configuration table no longer implies options beat env vars in Laravel.

Tests: two new Laravel tests (middleware, facade assertions); the suite passes on PHP 8.2 and 8.5, PHPStan is clean, and the example app tests pass.

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

no actionable findings

@roncohen
roncohen added this pull request to the merge queue Dec 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Dec 2, 2026
@roncohen
roncohen added this pull request to the merge queue Dec 3, 2026
@roncohen
roncohen removed this pull request from the merge queue due to a manual request Dec 3, 2026
@roncohen
roncohen added this pull request to the merge queue Dec 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Dec 3, 2026
…aravel users

- Add EnsureFlagsAreEnabled route middleware, aliased as "reflag":
  ->middleware('reflag:new-dashboard') or EnsureFlagsAreEnabled::using(...)
  responds 404 unless every flag resolves to true.
- Document the fake's assertions on the Reflag facade, so tests can use
  Reflag::assertFlagChecked() like Event::fake()/Event::assertDispatched().
- README: Laravel-first order, Pest test example, Inertia sharing, a
  Supervisor config for reflag:listen, onOneServer() in the schedule, an
  Artisan command table, a php artisan serve note, flag types next to
  reading flags, a clearer configuration table, and missing imports.
@roncohen
roncohen force-pushed the docs/laravel-native-readme branch from ab858ca to 1ca1a6f Compare December 3, 2026 07:32

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

no actionable findings

@roncohen
roncohen added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 335d30d Dec 3, 2026
29 checks passed
@roncohen
roncohen deleted the docs/laravel-native-readme branch December 3, 2026 07:36
@roncohen roncohen mentioned this pull request Dec 3, 2026
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.

1 participant