'onConsole', AdminPanelBooting::class => 'onAdmin', ]; /** * Register console commands. */ public function onConsole(ConsoleBooting $event): void { if (! $this->isEnabled()) { return; } $event->command(ActivityPruneCommand::class); } /** * Register admin panel components and routes. */ public function onAdmin(AdminPanelBooting $event): void { if (! $this->isEnabled()) { return; } // Register view namespace $event->views('core.activity', __DIR__.'/View/Blade'); // Register Livewire component (only if Livewire is available) if (app()->bound('livewire')) { Livewire::component('core.activity-feed', ActivityFeed::class); } // Bind service as singleton app()->singleton(ActivityLogService::class); } /** * Check if activity logging is enabled. */ protected function isEnabled(): bool { return config('core.activity.enabled', true); } }