<?php

namespace Modules\Service\Uploads\Upload;

use Modules\Service\Uploads\Interface\UploadInterface;

class ImageService implements  UploadInterface
{
    /**
     * Upload Image Service.
     *
     * @param $file
     * @return string
     */
    public function uploadFile($file) :string
    {
        $newFileName = rand(10000, 99999) . time() . '.' . $file->getClientOriginalName();
        $destinationPath = public_path('/storages/images');
        $file->move($destinationPath, $newFileName);

        return '/storages/images/' . $newFileName;
    }
}
