protected function createSchemaFromHeader($header)
    {
        $schema = [
            'name'        => $this->resource,
            'label'       => ucfirst($this->resource),
            'description' => 'Table created from CSV data import',
            'plural'      => ucfirst(str_plural($this->resource)),
            'field'       => []
        ];

        foreach ($header as $h) {
            $schema['field'][] = [
                'name'       => $h,
                'type'       => 'string',
                'default'    => null,
                'required'   => false,
                'allow_null' => true
            ];
        }

        return $schema;
    }
protected function createSchemaFromHeader($header)
    {
        $schema = [
            'name'        => $this->resource,
            'label'       => ucfirst($this->resource),
            'description' => 'Table created from CSV data import',
            'plural'      => ucfirst(str_plural($this->resource)),
            'field'       => []
        ];

        foreach ($header as $h) {
            $schema['field'][] = [
                'name'       => $h,
                'type'       => 'string',
                'default'    => null,
                'required'   => false,
                'allow_null' => true
            ];
        }

        return $schema;
    }
protected function createSchemaFromHeader ( $ header ) { $ schema = [ 'name' => $ this -> resource , 'label' => ucfirst ( $ this -> resource ) , 'description' => 'Table created from CSV data import' , 'plural' => ucfirst ( str_plural ( $ this -> resource ) ) , 'field' => [ ] ] ; foreach ( $ header as $ h ) { $ schema [ 'field' ] [ ] = [ 'name' => $ h , 'type' => 'string' , 'default' => null , 'required' => false , 'allow_null' => true ] ; } return $ schema ; }
Creates table schema definition based on CSV header

@param array $header

@return array
Creates table schema definition based on CSV header