public function setAttribute($key, $value)
    {
        if (isset($this->repositories[$key])) {
            if (! ($value instanceof $this->repositories[$key])) {
                return;
            }

            $className = str_replace('\\', '', $this->repositories[$key]);

            $this->cache->set(
                "repositories.{$className}.{$this->id}.{$key}",
                $value
            );

            return;
        }

        if ($str = $this->checkForMutator($key, 'set')) {
            $this->{$str}($value);

            return;
        }

        if (array_search($key, $this->fillable) !== false) {
            $this->attributes[$key] = $value;
        }
    }
public function setAttribute($key, $value)
    {
        if (isset($this->repositories[$key])) {
            if (! ($value instanceof $this->repositories[$key])) {
                return;
            }

            $className = str_replace('\\', '', $this->repositories[$key]);

            $this->cache->set(
                "repositories.{$className}.{$this->id}.{$key}",
                $value
            );

            return;
        }

        if ($str = $this->checkForMutator($key, 'set')) {
            $this->{$str}($value);

            return;
        }

        if (array_search($key, $this->fillable) !== false) {
            $this->attributes[$key] = $value;
        }
    }
public function setAttribute ( $ key , $ value ) { if ( isset ( $ this -> repositories [ $ key ] ) ) { if ( ! ( $ value instanceof $ this -> repositories [ $ key ] ) ) { return ; } $ className = str_replace ( '\\' , '' , $ this -> repositories [ $ key ] ) ; $ this -> cache -> set ( "repositories.{$className}.{$this->id}.{$key}" , $ value ) ; return ; } if ( $ str = $ this -> checkForMutator ( $ key , 'set' ) ) { $ this -> { $ str } ( $ value ) ; return ; } if ( array_search ( $ key , $ this -> fillable ) !== false ) { $ this -> attributes [ $ key ] = $ value ; } }
Sets an attribute on the part.

@param string $key   The key to the attribute.
@param mixed  $value The value of the attribute.

@return void
Sets an attribute on the part .