protected function instanceWrite($property, $value)
    {
        $field = "{$this->name}_{$property}";

        // This is not fillable as it is the one required attribute
        if ($property === 'file_name') {
            $this->getInstance()->setAttribute($field, $value);
        }

        // Queue state is optional and outside of the fillable
        elseif (preg_match('/^queue(d?)_/', $property)) {
            if ($this->isQueueable()) {
                $this->getInstance()->setAttribute($field, $value);
            }
        }

        // All other attributes must be fillable to have their values set
        else {
            if (in_array($field, $this->getInstance()->getFillable())) {
                $this->getInstance()->setAttribute($field, $value);
            }
        }
    }
protected function instanceWrite($property, $value)
    {
        $field = "{$this->name}_{$property}";

        // This is not fillable as it is the one required attribute
        if ($property === 'file_name') {
            $this->getInstance()->setAttribute($field, $value);
        }

        // Queue state is optional and outside of the fillable
        elseif (preg_match('/^queue(d?)_/', $property)) {
            if ($this->isQueueable()) {
                $this->getInstance()->setAttribute($field, $value);
            }
        }

        // All other attributes must be fillable to have their values set
        else {
            if (in_array($field, $this->getInstance()->getFillable())) {
                $this->getInstance()->setAttribute($field, $value);
            }
        }
    }
protected function instanceWrite ( $ property , $ value ) { $ field = "{$this->name}_{$property}" ; // This is not fillable as it is the one required attribute if ( $ property === 'file_name' ) { $ this -> getInstance ( ) -> setAttribute ( $ field , $ value ) ; } // Queue state is optional and outside of the fillable elseif ( preg_match ( '/^queue(d?)_/' , $ property ) ) { if ( $ this -> isQueueable ( ) ) { $ this -> getInstance ( ) -> setAttribute ( $ field , $ value ) ; } } // All other attributes must be fillable to have their values set else { if ( in_array ( $ field , $ this -> getInstance ( ) -> getFillable ( ) ) ) { $ this -> getInstance ( ) -> setAttribute ( $ field , $ value ) ; } } }
Set an attachment attribute on the underlying model instance.

@param string $property
@param mixed  $value

@return void
Set an attachment attribute on the underlying model instance .