-
-
Notifications
You must be signed in to change notification settings - Fork 254
Leverage user() helper
#1832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leverage user() helper
#1832
Conversation
📝 WalkthroughWalkthroughThree files updated to replace Changes
Pre-merge checks❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
app/Filament/Admin/Resources/Users/UserResource.php(1 hunks)app/Filament/Server/Pages/Startup.php(1 hunks)app/Models/ActivityLog.php(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
app/Models/ActivityLog.php (2)
app/helpers.php (1)
user(127-130)app/Models/User.php (1)
can(357-370)
app/Filament/Admin/Resources/Users/UserResource.php (2)
app/Models/ActivityLog.php (1)
actor(93-96)app/helpers.php (1)
user(127-130)
app/Filament/Server/Pages/Startup.php (3)
app/helpers.php (1)
user(127-130)app/Models/User.php (1)
can(357-370)app/Models/Permission.php (1)
Permission(11-221)
🔇 Additional comments (2)
app/Models/ActivityLog.php (1)
168-168: LGTM! Proper null-safe check.The change from
auth()->user()->can(...)touser()?->can(...)correctly handles the case where no user is authenticated, preventing potential null reference errors while maintaining the intended logic.app/Filament/Server/Pages/Startup.php (1)
54-54: LGTM! Consistent with existing patterns.The change from
auth()->user()->can(...)touser()?->can(...)properly handles unauthenticated scenarios and aligns with the null-safe pattern already used throughout this file (lines 88, 126, 142, 147).
Those were added after #1768