<?php
namespace App\Services\Upload;

use Illuminate\Support\Facades\Storage;

class ImageService
{
    public static function uploadImage($image)
    {
        $newFileName = rand(10000,99999).time().'.'.$image->getClientOriginalName();
        $destinationPath = public_path('/storages/files');
        $image->move($destinationPath, $newFileName);
        
        return '/storages/files/'.$newFileName;
    }
}
