attributes->get('workspace', 'main'); $this->workspace = $workspaceService->get($slug) ?? $workspaceService->get('main'); $this->loadPosts(); } protected function loadPosts(): void { try { $workspaceModel = Workspace::where('slug', $this->workspace['slug'])->first(); if (! $workspaceModel) { $this->posts = []; $this->loading = false; return; } $render = app(ContentRender::class); $result = $render->getPosts($workspaceModel, page: 1, perPage: 20); $this->posts = $result['posts'] ?? []; } catch (\Exception $e) { $this->posts = []; } $this->loading = false; } public function render() { return view('content::web.blog', [ 'posts' => $this->posts, 'workspace' => $this->workspace, ])->layout('shared::layouts.satellite', [ 'title' => 'Blog | '.$this->workspace['name'], 'workspace' => $this->workspace, ]); } }