src/Form/SharpForm.php
public function create(): array
    {
        $attributes = collect($this->getDataKeys())
            ->flip()
            ->map(function() {
                return null;
            })->all();

        // Build a fake Model class based on attributes
        return $this->transform(new class($attributes) extends \stdClass
        {
            public function __construct($attributes)
            {
                $this->attributes = $attributes;

                foreach($attributes as $name => $value) {
                    $this->$name = $value;
                }
            }
            public function toArray()
            {
                return $this->attributes;
            }
        });
    }
public function create(): array
    {
        $attributes = collect($this->getDataKeys())
            ->flip()
            ->map(function() {
                return null;
            })->all();

        // Build a fake Model class based on attributes
        return $this->transform(new class($attributes) extends \stdClass
        {
            public function __construct($attributes)
            {
                $this->attributes = $attributes;

                foreach($attributes as $name => $value) {
                    $this->$name = $value;
                }
            }
            public function toArray()
            {
                return $this->attributes;
            }
        });
    }
public function create ( ) : array { $ attributes = collect ( $ this -> getDataKeys ( ) ) -> flip ( ) -> map ( function ( ) { return null ; } ) -> all ( ) ; // Build a fake Model class based on attributes return $ this -> transform ( new class ( $ attributes ) extends \ stdClass { public function __construct ( $ attributes ) { $ this -> attributes = $ attributes ; foreach ( $ attributes as $ name => $ value ) { $ this -> $ name = $ value ; } } public function toArray ( ) { return $ this -> attributes ; } } ) ; }
Pack new Model data as JSON.

@return array
Pack new Model data as JSON .