Owl\Repositories\Eloquent\ImageRepository::createImage PHP Method

createImage() public method

Create a new image.
public createImage ( $img ) : Illuminate\Database\Eloquent\Model
return Illuminate\Database\Eloquent\Model
    public function createImage($img)
    {
        $image = $this->image->newInstance();
        $image->alt_text = $img->alt_text;
        $image->external_path = $img->external_path;
        $image->external_name = $img->external_name;
        $image->save();
        return $image;
    }