AbstractFactory.php
public function process()
    {
        $this->data = array_values($this->data);

        if (isset($this->data[0])) {
            $data = $this->data;
        } else {
            $data = [$this->data];
        }

        foreach ($data as $key => $value) {
            $model = $this->fill($key, collect($value));
            $this->collection->push($model);
        }

        return $this->collection;
    }
public function process()
    {
        $this->data = array_values($this->data);

        if (isset($this->data[0])) {
            $data = $this->data;
        } else {
            $data = [$this->data];
        }

        foreach ($data as $key => $value) {
            $model = $this->fill($key, collect($value));
            $this->collection->push($model);
        }

        return $this->collection;
    }
public function process ( ) { $ this -> data = array_values ( $ this -> data ) ; if ( isset ( $ this -> data [ 0 ] ) ) { $ data = $ this -> data ; } else { $ data = [ $ this -> data ] ; } foreach ( $ data as $ key => $ value ) { $ model = $ this -> fill ( $ key , collect ( $ value ) ) ; $ this -> collection -> push ( $ model ) ; } return $ this -> collection ; }
Process the raw data and return a collection filled with populated models.

@return \Illuminate\Support\Collection
Process the raw data and return a collection filled with populated models .