-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Hi 👋 First, thank you for the awesome Nova Logs Tool—it’s a really helpful addition for managing Laravel logs from the Nova interface!
📌 Feature Request
It would be great to have the ability to dynamically filter log files shown in the Logs Tool based on the logged-in Nova user (e.g., by role or permissions). Currently, the include_files option in the log-viewer.php config is static and does not support runtime evaluation.
🎯 Use Case
In multi-tenant or role-based systems, different user types (e.g., admin, dev, qa) should only have access to logs relevant to their role:
Admins see all logs (e.g., *.log)
Devs only see specific files (e.g., xyz-*.log)
QA might see sanitized error logs
💡 Suggested Implementation
One potential solution could be:
Allow the tool to accept dynamic filters via withMeta() or a callback.
Or, allow overriding the file list via a published method/hook or via Nova ToolServiceProvider.
Example idea:
(new LogsTool())
->withIncludeFilesCallback(function (User $user) {
return $user->hasRole('admin') ? ['*.log'] : ['terraform*.log'];
});🙏 Final Thoughts
This would greatly enhance the flexibility and security of the Logs Tool in production environments. Happy to contribute a PR if you’re open to this idea!
Thanks again for your great work!