protected function castAttribute($key, $value)
    {
        if ($value === null) {
            return $value;
        }

        if ($this->getCastType($key) === 'serialize') {
            return $this->fromSerialize($value);
        }

        return parent::castAttribute($key, $value);
    }
protected function castAttribute($key, $value)
    {
        if ($value === null) {
            return $value;
        }

        if ($this->getCastType($key) === 'serialize') {
            return $this->fromSerialize($value);
        }

        return parent::castAttribute($key, $value);
    }
protected function castAttribute ( $ key , $ value ) { if ( $ value === null ) { return $ value ; } if ( $ this -> getCastType ( $ key ) === 'serialize' ) { return $ this -> fromSerialize ( $ value ) ; } return parent :: castAttribute ( $ key , $ value ) ; }
Cast model attribute. Extend laravel attribute casting mutators by serialized array
@param string $key
@param mixed $value
@return mixed
Cast model attribute . Extend laravel attribute casting mutators by serialized array