<?php
 namespace App\PageBuilder\Components\Content; use App\PageBuilder\PageComponent; class HeadingComponent extends PageComponent { public function key(): string { return 'heading'; } public function category(): string { return 'content'; } public function label(): string { return 'Heading'; } public function icon(): string { return 'fas fa-heading'; } public function schema(): array { return [ 'text' => ['type' => 'text', 'label' => 'Metin', 'required' => true], 'level' => ['type' => 'select', 'label' => 'Seviye', 'options' => ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], 'default' => 'h2'], 'options' => [ 'color' => ['type' => 'color_token', 'default' => 'dark'], 'padding' => ['type' => 'padding_token', 'default' => 'sm'], 'alignment' => ['type' => 'alignment_token', 'default' => 'left'], ], ]; } public function defaults(): array { return [ 'text' => 'Yeni Başlık', 'level' => 'h2', 'options' => ['color' => 'dark', 'padding' => 'sm', 'alignment' => 'left'], ]; } public function render(array $data, array $options): string { return view('page-builder.components.heading', compact('data', 'options'))->render(); } } 