/** * Attach image (only filename) to Product. * * @helper Model create|attach * @param string $image * @return \Veer\Services\Administration\Elements\Product */ public function attachImage($image) { $new = new \Veer\Models\Image(); $new->img = $image; $new->save(); $new->products()->attach($this->id); return $this; }