| null */ protected ?array $columns = null; /** * @param array | int | null $columns */ public function columns(array | int | null $columns = 2): static { if (! is_array($columns)) { $columns = [ 'lg' => $columns, ]; } $this->columns = [ ...($this->columns ?? []), ...$columns, ]; return $this; } /** * @return array | int | null */ public function getColumns(?string $breakpoint = null): array | int | null { $columns = $this->getColumnsConfig(); if ($breakpoint !== null) { return $columns[$breakpoint] ?? null; } return $columns; } /** * @return array */ public function getColumnsConfig(): array { if ($this instanceof ComponentContainer && $this->getParentComponent()) { return $this->getParentComponent()->getColumnsConfig(); } return $this->columns ?? [ 'default' => 1, 'sm' => null, 'md' => null, 'lg' => null, 'xl' => null, '2xl' => null, ]; } }