Example #1
0
 /**
  * Responds with collection.
  *
  * @param bool $paginationEnabled
  *
  * @return array
  * @throws \InvalidArgumentException
  */
 public function withCollection($paginationEnabled = false)
 {
     $this->collection->setData($this->content);
     $this->collection->setTransformer($this->transformer);
     $this->paginate($paginationEnabled);
     return $this->fractal->createData($this->collection)->toArray();
 }