public function transform($data)
    {
        if ($data instanceof FormBuilder) {
            $response = $data->getRawResponse();

            foreach ($response['fieldsets'] as $fieldset) {
                $this->transformFieldset($fieldset);
            }

            return [
                'form' => [
                    'name'      => array_get($response, 'name'),
                    'rules'     => array_get($response, 'rules', []),
                    'fieldsets' => $this->fieldsets,
                ],
            ];
        }

        return parent::transform($data);
    }
public function transform($data)
    {
        if ($data instanceof FormBuilder) {
            $response = $data->getRawResponse();

            foreach ($response['fieldsets'] as $fieldset) {
                $this->transformFieldset($fieldset);
            }

            return [
                'form' => [
                    'name'      => array_get($response, 'name'),
                    'rules'     => array_get($response, 'rules', []),
                    'fieldsets' => $this->fieldsets,
                ],
            ];
        }

        return parent::transform($data);
    }
public function transform ( $ data ) { if ( $ data instanceof FormBuilder ) { $ response = $ data -> getRawResponse ( ) ; foreach ( $ response [ 'fieldsets' ] as $ fieldset ) { $ this -> transformFieldset ( $ fieldset ) ; } return [ 'form' => [ 'name' => array_get ( $ response , 'name' ) , 'rules' => array_get ( $ response , 'rules' , [ ] ) , 'fieldsets' => $ this -> fieldsets , ] , ] ; } return parent :: transform ( $ data ) ; }
Transform FormBuilder data and return as array.

@param FormBuilder $data
@return array
Transform FormBuilder data and return as array .