1. Go to this page and download the library: Download renepardon/croppa 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/ */
// Early in App bootstrapping, bind a Flysystem instance. This example assumes
// you are using the `graham-campbell/flysystem` Laravel adapter package
// https://github.com/GrahamCampbell/Laravel-Flysystem
App::singleton('s3', function($app) {
return $app['flysystem']->connection();
});
// Or alternatively, without the Laravel-Flysystem package
App::singleton('s3', function () {
return Storage::disk('s3')->getDriver();
});
// Croppa config.php
return [
'src_dir' => 's3',
'crops_dir' => public_path().'/uploads',
'path' => 'uploads/(.*)$',
];