-
-
Notifications
You must be signed in to change notification settings - Fork 254
Add custom render hooks to our footer #1942
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
Conversation
📝 WalkthroughWalkthroughAdded two render-hook invocation points to the footer Blade template (start and end) and introduced a new string-backed PHP enum Changes
Pre-merge checks✅ Passed checks (3 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 |
rmartinoscar
left a 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.
Enums ?
rmartinoscar
left a 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.
Chef's kiss
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: 0
🧹 Nitpick comments (1)
resources/views/filament/layouts/footer.blade.php (1)
2-2: Consider using Blade directives for improved readability (optional).The fully qualified class names are correct but make the template verbose. For improved readability, you could optionally use Blade's
@usedirective (if using PHP 8.1+):@use('Filament\Support\Facades\FilamentView') @use('App\Enums\CustomRenderHooks') {{ FilamentView::renderHook(CustomRenderHooks::FooterStart->value) }} ... {{ FilamentView::renderHook(CustomRenderHooks::FooterEnd->value) }}However, the current implementation is perfectly valid and avoids potential naming conflicts.
Also applies to: 18-18
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/Enums/CustomRenderHooks.php(1 hunks)resources/views/filament/layouts/footer.blade.php(2 hunks)
🔇 Additional comments (3)
app/Enums/CustomRenderHooks.php (1)
5-9: LGTM! Clean implementation of render hook identifiers.The string-backed enum provides type safety for the footer render hooks and follows Laravel/Filament naming conventions. The implementation is straightforward and serves its purpose well.
resources/views/filament/layouts/footer.blade.php (2)
2-3: Hook integration looks correct.The FooterStart hook is properly placed at the beginning of the footer content, allowing plugins to inject content before the copyright notice. The syntax correctly accesses the enum's string value with
->value.
18-18: FooterEnd hook correctly positioned.The hook is properly placed at the end of the footer, allowing plugins to append content after all existing footer elements. The implementation is consistent with the FooterStart hook.
Allows plugins to add to our footer, e.g. additional links or info texts.