public getAttribute ( string $key ) : mixed | ||
$key | string | |
return | mixed |
public function getAttribute($key)
{
// parent call first.
if (($attr = parent::getAttribute($key)) !== null) {
return $attr;
}
// there was no attribute on the model
// retrieve the data from meta relationship
return $this->getMeta($key);
}