PHP code example of vishal-pawar / image-convert

1. Go to this page and download the library: Download vishal-pawar/image-convert library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vishal-pawar / image-convert example snippets



use VishalPawar\ImageConvert\helper\ImageHelper;

Route::post('image-upload' , function(Request $request){
    return ImageHelper::saveImage("uploads/post" , $request->image);
});



use VishalPawar\ImageConvert\helper\ImageHelper;

Route::post('image-upload' , function(Request $request){
    return ImageHelper::resizeSaveImage("uploads/post" , $request->image , 320 , 320);
});



use VishalPawar\ImageConvert\helper\ImageHelper;

Route::post('image-upload' , function(Request $request){
    return ImageHelper::saveWebpImage("uploads/post" , $request->image);
});



use VishalPawar\ImageConvert\helper\ImageHelper;

Route::post('image-upload' , function(Request $request){
    return ImageHelper::resizeSaveWebpImage("uploads/post" , $request->image , 320 , 320);
});




return [

    /*
    |--------------------------------------------------------------------------
    | Autoloaded Service Providers
    |--------------------------------------------------------------------------
    |
    | The service providers listed here will be automatically loaded on the
    | request to your application. Feel free to add your own services to
    | this array to grant expanded functionality to your applications.
    |
     */

    'do_spaces'    => [
        'driver'         => 's3',
        'key'            => env('DO_KEY'),
        'secret'         => env('DO_SECRET'),
        'region'         => env('DO_REGION'),
        'bucket'         => env('DO_BUCKET'),
        "endpoint"       => env("DO_ENPOINT"),
        "originendpoint" => env("ORIGIN_ENDPOINT"), //full end point of the do spaces
    ],

    
];