values() public method

Reset the keys on the underlying array.
public values ( ) : static
return static
Example #1
0
 public function getPendingUrls() : Collection
 {
     return $this->pending->values();
 }
 /**
  * @param \Illuminate\Support\Collection $repositories
  * @return $this
  */
 public function by(Collection $repositories)
 {
     $this->repositories = $repositories->values();
     return $this;
 }
 /**
  * Set product images
  *
  * @param Illuminate\Support\Collection $images
  *
  * @return \App\Models\Product
  */
 public function setImages($images)
 {
     $oldImages = new Collection(json_decode($this->images));
     $maxProductImg = (int) config('front.max_product_img');
     if ($images->count() === $maxProductImg || !$oldImages->count()) {
         $this->images = $images->values()->toJson();
     } else {
         foreach ($images as $k => $image) {
             $oldImages[$k] = $image;
         }
         $this->images = $oldImages->values()->toJson();
     }
     return $this;
 }
Example #4
0
 /**
  * Get the instance as an array.
  *
  * @return array
  */
 public function toArray()
 {
     return ['id' => $this->id, 'view' => $this->view, 'attributes' => $this->attributes, 'tree' => $this->toArrayTree(), 'items' => $this->items->values()->toArray()];
 }