Illuminate\Database\Eloquent\Model::getAttributeFromArray PHP Method

getAttributeFromArray() protected method

Get an attribute from the $attributes array.
protected getAttributeFromArray ( string $key ) : mixed
$key string
return mixed
    protected function getAttributeFromArray($key)
    {
        if (array_key_exists($key, $this->attributes)) {
            return $this->attributes[$key];
        }
    }

Usage Example

Example #1
0
 /**
  * Provides public access to get the raw attribute value from the model.
  * Used in areas where no mutations are required but performance is critical.
  * @param $key
  * @return mixed
  */
 public function getRawAttribute($key)
 {
     return parent::getAttributeFromArray($key);
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::getAttributeFromArray
Model