Illuminate\Support\Collection::put PHP Метод

put() публичный Метод

Put an item in the collection by key.
public put ( mixed $key, mixed $value )
$key mixed
$value mixed
    public function put($key, $value)
    {
        $this->offsetSet($key, $value);
        return $this;
    }

Usage Example

Пример #1
5
 /**
  * Add a tenant to scope by.
  *
  * @param string|Model $tenant
  * @param mixed|null   $id
  */
 public function addTenant($tenant, $id = null)
 {
     if (func_num_args() == 1) {
         $id = $tenant->getKey();
     }
     $this->tenants->put($this->getTenantKey($tenant), $id);
 }
All Usage Examples Of Illuminate\Support\Collection::put