本文整理汇总了PHP中Illuminate\Support\Collection::values方法的典型用法代码示例。如果您正苦于以下问题:PHP Collection::values方法的具体用法?PHP Collection::values怎么用?PHP Collection::values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Collection
的用法示例。
在下文中一共展示了Collection::values方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPendingUrls
public function getPendingUrls() : Collection
{
return $this->pending->values();
}
示例2: by
/**
* @param \Illuminate\Support\Collection $repositories
* @return $this
*/
public function by(Collection $repositories)
{
$this->repositories = $repositories->values();
return $this;
}
示例3: setImages
/**
* 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;
}
示例4: toArray
/**
* 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()];
}