value], ... ] * @param null|string $value */ public function __construct( private readonly string $title, private readonly string $name, private readonly array $list, private readonly ?string $value = '' ) { } protected function getName(): string { return $this->name; } private function getTitle(): string { return Str::ucfirst($this->title); } private function getValue(): string { return (string) old($this->getRequestName(), $this->value); } private function getList(): array { return $this->list; } public function render(): View { return view('private.components.forms.select', [ 'title' => $this->getTitle(), 'name' => $this->getName(), 'requestName' => $this->getRequestName(), 'list' => $this->getList(), 'value' => $this->getValue() ]); } }