src/Services/UploadsService.php
/**
     * Handle an image upload via the upload image section (not blog post featured image).
     *
     * @param $uploadedImage
     * @param string $imageTitle
     * @return array
     * @throws Exception
     */
Handle an image upload via the upload image section (not blog post featured image).
@param $uploadedImage
@param string $imageTitle
@return array
@throws Exception
Handle an image upload via the upload image section ( not blog post featured image ) . @param $uploadedImage @param string $imageTitle @return array @throws Exception
public function processUpload($uploadedImage, string $imageTitle): array
    {
        $uploadedImageDetails = [];
        $this->increaseMemoryLimit();
        if (config('blogetc.image_store_full_size')) {
            $uploadedImageDetails['blogetc_full_size'] = $this->uploadAndResize(
                null,
                $imageTitle,
                'fullsize',
                $uploadedImage
            );
        }
        foreach ((array) config('blogetc.image_sizes') as $size => $imageSizeDetails) {
            $uploadedImageDetails[$size] = $this->uploadAndResize(
                null,
                $imageTitle,
                $imageSizeDetails,
                $uploadedImage
            );
        }
        $this->storeInDatabase(
            null,
            $imageTitle,
            UploadedPhoto::SOURCE_IMAGE_UPLOAD,
            Auth::id(),
            $uploadedImageDetails
        );
        return $uploadedImageDetails;
    }
public function processUpload ( $ uploadedImage , string $ imageTitle ) : array { $ uploadedImageDetails = [ ] ; $ this -> increaseMemoryLimit ( ) ; if ( config ( 'blogetc.image_store_full_size' ) ) { $ uploadedImageDetails [ 'blogetc_full_size' ] = $ this -> uploadAndResize ( null , $ imageTitle , 'fullsize' , $ uploadedImage ) ; } foreach ( ( array ) config ( 'blogetc.image_sizes' ) as $ size => $ imageSizeDetails ) { $ uploadedImageDetails [ $ size ] = $ this -> uploadAndResize ( null , $ imageTitle , $ imageSizeDetails , $ uploadedImage ) ; } $ this -> storeInDatabase ( null , $ imageTitle , UploadedPhoto :: SOURCE_IMAGE_UPLOAD , Auth :: id ( ) , $ uploadedImageDetails ) ; return $ uploadedImageDetails ; }
Handle an image upload via the upload image section (not blog post featured image).
Handle an image upload via the upload image section ( not blog post featured image ) .
// to save in db later // Store as full size // Store the image data in db: