world = in_array($world, CmsArticle::WORLDS, true) ? $world : CmsArticle::WORLD_INTERIOR; $this->loadPosts(); $this->loadThemeContent(); } private function loadPosts() { $this->posts = collect(CmsArticle::forFrontend($this->world))->map(function (array $article) { return [ 'slug' => $article['slug'], 'title' => $article['title'], 'excerpt' => $article['content']['intro'] ?? '', 'image' => $article['image'], 'date' => $article['date'], 'readTime' => $article['readTime'], ]; })->values()->all(); } private function loadThemeContent() { $this->content = cms_theme_section( $this->world === CmsArticle::WORLD_IMMOBILIEN ? 'magazin_list_immobilien' : 'magazin_list' ); } public function render() { return view('livewire.web.components.sections.magazin-list', [ 'posts' => $this->posts, ]); } }