articleId = (int) $id; $this->loadArticle(); $this->loadRelatedArticles(); $this->loadThemeContent(); } private function loadArticle() { $articles = $this->getArticlesData(); $this->article = $articles[$this->articleId] ?? $articles[1]; } private function loadRelatedArticles() { $articles = $this->getArticlesData(); $this->relatedArticles = collect($articles) ->filter(fn ($article, $key) => $key != $this->articleId) ->take(2) ->values() ->toArray(); } private function loadThemeContent() { $this->content = cms_theme_section('magazin_detail'); } private function getArticlesData() { return trans('b2in.articles'); } public function render() { return view('livewire.web.components.sections.magazin-detail', [ 'article' => $this->article, 'relatedArticles' => $this->relatedArticles, ]); } }