jugalkishoredots / s3-with-watermark
This package helps to storage images with water mark
Requires
- intervention/image: ^2.7
- league/flysystem-aws-s3-v3: ^3.0
README
This package helps to storage images with water mark
Requirements
This package requires Laravel 9
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Laravel project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require jugalkishoredots/s3-with-watermark
-
Then use this namespace in your controller:
use Dotsquares\S3WithWatermark\S3WithWatermarkController;
-
Use this code example:
$media_path = 'files/test/'; $watermark = 'images/logo.png'; // if you want to store without WaterMark replace with (null) value. $data = S3WithWatermarkController::store($request->file, $media_path, $watermark);
Environment Variables
AWS Environment Variables
The package makes use of the existing AWS/S3 configuration within Laravel, so if you've already configured your app to use S3, you are good to go! Of course, provided you are using the most recent AWS/S3 config statements (these were changed not too long ago in Laravel). To make sure, check your .env
file for the following:
AWS_ACCESS_KEY_ID=<YOUR KEY>
AWS_SECRET_ACCESS_KEY=<YOUR SECRET>
AWS_DEFAULT_REGION=<DEFAULT REGION>
AWS_BUCKET=<YOUR BUCKET NAME>
If you aren't sure what value to use in AWS_DEFAULT_REGION
, check this page for more information (use the value shown in the Region
column in the table on that page.