| Htmlable | Closure | null $heading */ final public function __construct(string | array | Htmlable | Closure | null $heading = null) { is_array($heading) ? $this->childComponents($heading) : $this->heading($heading); } /** * @param string | array | Htmlable | Closure | null $heading */ public static function make(string | array | Htmlable | Closure | null $heading = null): static { $static = app(static::class, ['heading' => $heading]); $static->configure(); return $static; } protected function setUp(): void { parent::setUp(); $this->columnSpan('full'); } public function aside(bool | Closure | null $condition = true): static { $this->isAside = $condition; return $this; } public function getId(): ?string { $id = parent::getId(); if (filled($id)) { return $id; } $heading = $this->getHeading(); if (blank($heading)) { return null; } $id = Str::slug($heading); if ($statePath = $this->getStatePath()) { $id = "{$statePath}.{$id}"; } return $id; } public function getKey(): ?string { return parent::getKey() ?? ($this->getActions() ? $this->getId() : null); } public function canConcealComponents(): bool { return $this->isCollapsible(); } public function isAside(): bool { return (bool) ($this->evaluate($this->isAside) ?? false); } public function formBefore(bool | Closure $condition = true): static { $this->isFormBefore = $condition; return $this; } public function isFormBefore(): bool { return (bool) $this->evaluate($this->isFormBefore); } }