Illuminate\Support\Collection::offsetGet PHP Méthode

offsetGet() public méthode

Get an item at a given offset.
public offsetGet ( mixed $key ) : mixed
$key mixed
Résultat mixed
    public function offsetGet($key)
    {
        return $this->items[$key];
    }

Usage Example

 /**
  * @param  mixed $key
  * @return ServiceInterface
  * @throws ServiceNotFoundInCollectionException
  */
 public function offsetGet($key)
 {
     if (!isset($this->items[$key])) {
         throw new ServiceNotFoundInCollectionException("Service with key '{$key}' not found in collection");
     }
     return parent::offsetGet($key);
 }
All Usage Examples Of Illuminate\Support\Collection::offsetGet