Private
Public Access
1
0

feat: enhance CreditsPlus and NavbarManager extensions with improved role checks, route handling, and migration logic for better functionality and compatibility across databases

This commit is contained in:
2025-12-03 15:47:36 -05:00
parent 6d4de10a83
commit 1fd95e4edf
5 changed files with 180 additions and 20 deletions

View File

@@ -65,6 +65,22 @@ class CreditsPlus extends Extension
// Use view composer to add credits data to navigation
View::composer('components.navigation.index', function ($view) use ($extension, $extensionPath) {
try {
// Don't run in admin panel - this is crucial to avoid conflicts
if (app()->runningInConsole()) {
return;
}
// Check if we're in admin context
$currentPath = request()->path();
if (str_starts_with($currentPath, 'admin') || str_contains($currentPath, '/admin/')) {
return;
}
// Don't run for API routes
if (str_starts_with($currentPath, 'api')) {
return;
}
if (!Auth::check()) {
return;
}