Esempio n. 1
0
 /**
  * Override readAttribute to allow for having custom setMethods
  *
  * @param string $name
  *
  * @return mixed
  */
 public function readAttribute($name)
 {
     $method = 'get' . ucfirst($name);
     if (method_exists($this, $method)) {
         return $this->{$method}();
     } else {
         return parent::readAttribute($name);
     }
 }