<?php
use Illuminate\Http\Request;
use Intervention\Image\ImageManager;

if (!function_exists('uploadOriginalImage')) {

    /**
     * description
     *
     * @param
     * @return
     */
    function uploadOriginalImage($image)
    {
        
        $relPathOriginal = '/multimedia/uploads/images/promotions/';
        
        
        if (!file_exists(public_path($relPathOriginal))) {
            mkdir(public_path($relPathOriginal), 777, true);
        }
       
        $filename = time() . '.' . $image->getClientOriginalName();
        $path = $relPathOriginal.'original/'.$filename;
        (new ImageManager)
        ->make($image)
        ->resize(100, 100)
        ->save(public_path($path));
       
        return $path;
        
    }
}
