loadViewsFrom($this->resourcePath('views'), self::NAMESPACE); $this->registerLivewireComponents(); $this->registerShortcodes(); } private function registerLivewireComponents(): void { if (! class_exists(Livewire::class)) { return; } Livewire::addNamespace(self::NAMESPACE, $this->resourcePath('views/components')); } private function registerShortcodes(): void { add_shortcode('acorn_hello', fn () => view(self::NAMESPACE . '::hello-world')->render()); } private function resourcePath(string $path = ''): string { return dirname(__DIR__, 2) . '/resources/' . ltrim($path, '/'); } }