name = $name; $this->form = $form; } /** * @return mixed */ public function getName() { return $this->name; } /** * @param mixed $name * @return FormTab */ public function name($name) { $this->name = $name; return $this; } /** * @param Row|\Closure $closure * @return $this */ public function row($closure) { if ($closure instanceof \Closure) { $row = new Row(); call_user_func($closure, $row, $this->form); $this->rows = collect($this->rows)->push($row); } else { $this->rows = collect($this->rows)->push($closure); } return $this; } public function jsonSerialize() { return ['name' => $this->name, 'rows' => $this->rows]; } }