public function setImageAttribute($value)
    {
        $value = $this->resolveMediableValue($value);

        // Dont store or make lazy store
        // if current model doesn't exists in database.
        if (!$this->exists && $value) {
            return $this->attributes['image'] = $value;
        } elseif (!$this->exists) {
            return;
        }

        $this->mediables()->sync($value);

        $this->touch();
    }
public function setImageAttribute($value)
    {
        $value = $this->resolveMediableValue($value);

        // Dont store or make lazy store
        // if current model doesn't exists in database.
        if (!$this->exists && $value) {
            return $this->attributes['image'] = $value;
        } elseif (!$this->exists) {
            return;
        }

        $this->mediables()->sync($value);

        $this->touch();
    }
public function setImageAttribute ( $ value ) { $ value = $ this -> resolveMediableValue ( $ value ) ; // Dont store or make lazy store // if current model doesn't exists in database. if ( ! $ this -> exists && $ value ) { return $ this -> attributes [ 'image' ] = $ value ; } elseif ( ! $ this -> exists ) { return ; } $ this -> mediables ( ) -> sync ( $ value ) ; $ this -> touch ( ) ; }
Image setter.

@param \Routegroup\Media\File|\Illuminate\Http\UploadedFile|integer $value
Image setter .