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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user