belongsTo(Page::class); } public function block(): BelongsTo { return $this->belongsTo(Block::class); } // Возвращает HTML для рендера на публичной странице public function getRenderedContent(): string { if ($this->type === 'content') { return (string) $this->content; } if ($this->block && $this->block->is_active) { return $this->block->render(); } return ''; } }