<?php

namespace App\Traits;

trait UppercaseAttributes
{
    protected function getAttributeFromArray($key)
    {
        $upperKey = strtoupper($key);

        return parent::getAttributeFromArray($upperKey);
    }

    public function __get($key)
    {
        $upperKey = strtoupper($key);

        return parent::__get($upperKey);
    }

    public function __set($key, $value)
    {
        $upperKey = strtoupper($key);

        return parent::__set($upperKey, $value);
    }
}
