Repository navigation
Conversation
Security: - Ignore empty and whitespace-only entries in the admin list, so a user without an email can no longer match an empty ADMINS value. - Compare emails strictly (no loose numeric-string comparison). - Users without an email or without the Adminable trait are never admins instead of causing a TypeError/fatal error. - Middleware now responds 403 for authenticated non-admins (401 only for guests). - Update locked dependencies (Laravel 13.39, Symfony 7.4.x, ...); composer audit reports no advisories. Fixes and improvements: - Fix the migration stub missing its trailing semicolon (parse error). - Resolve the driver lazily and fail with a clear exception on an unknown driver. - Read config/cache per check so long-running workers (Octane, queues) don't keep a stale admin list; add MySQLDriver::flush() and an optional database connection setting. - Use publishesMigrations() so published migrations get a timestamp. - Require Laravel 12 or 13 and declare the illuminate components used; drop the unused spatie/macroable dev dependency. - CI: test Laravel 12 and 13, run composer audit, read-only token. - Add tests for the gate, Blade directive, MySQL driver and edge cases. - Update README for Laravel 11+ application structure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011nsvciJbFZ9rTyYWtbFh3d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Security
ADMINS=used to become[''], so a user with an empty email counted as an admin. Empty and whitespace-only entries are now ignored, and users without an email are never admins.in_array, so e.g."1e3"matched"1000".Adminabletrait, or with anullemail, now simply isn't an admin instead of causing a fatal error / TypeError.403for authenticated non-admins; guests still get401.composer auditreports no advisories.Fixes & improvements
;afterreturn new class {...}(parse error when run). Rollback now drops the index before the column.InvalidArgumentException.MySQLDriver::flush()to clear the cached list, plus an optionalADMINS_MYSQL_CONNECTIONsetting.publishesMigrations()so published migrations get a proper timestamp.>=10), declare the illuminate components used, drop unusedspatie/macroable.composer auditstep, read-only token. PHPUnit config updated for v12.@adminBlade directive, the MySQL driver (incl. caching) and the edge cases above.bootstrap/app.php,AppServiceProvider).403instead of401.getAdminEmail()now returns?string; models overriding it must update the signature.Testing
Generated by Claude Code