loadMigrationsFrom(__DIR__ . '/../Database/migrations'); // Only register views and components if not in admin context if (!$this->isAdminContext()) { // Register view namespace $this->loadViewsFrom(__DIR__ . '/../resources/views', 'navbar-manager'); // Register Blade components Blade::componentNamespace('Paymenter\\Extensions\\Others\\NavbarManager\\View\\Components', 'navbar-manager'); // Register global Blade directive for easy navbar usage Blade::directive('navbarManagerLinks', function ($expression) { return ""; }); } } /** * Check if we're in admin context */ private function isAdminContext(): bool { if (app()->runningInConsole()) { return false; } try { $currentPath = request()->path(); return str_starts_with($currentPath, 'admin') || str_contains($currentPath, '/admin/') || str_starts_with($currentPath, 'filament') || request()->is('admin') || request()->is('admin/*') || request()->is('filament/*'); } catch (\Exception $e) { return false; } } }