Download the PHP package rkcreative/aws-image-handler without Composer

On this page you can find all versions of the php package rkcreative/aws-image-handler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package aws-image-handler

AWS Serverless Image Handler Laravel Package

Latest Stable Version Total Downloads GitHub stars Last Commit CI

This package provides a Laravel wrapper for the AWS Serverless Image Handler service.

Requirements

Installation

You can install the package via composer:

After installing the package, the AwsImageHandlerServiceProvider and the ImageHandler facade are automatically registered, thanks to Laravel's package discovery feature.

If you're using Laravel 5.5 or later, no further steps are required. You can start using the ImageHandler facade right away:

If you're using a version of Laravel that's earlier than 5.5, you'll need to manually register the service provider and facade. Add the following lines to the providers and aliases arrays in your config/app.php file:

Configuration

After installing the package, you should publish the configuration file:

This command will create a aws-image-handler.php configuration file in your config directory. In this file, you can set your distribution URL and the default S3 bucket:

You should also add the AWS_IMAGE_HANDLER_URL and AWS_IMAGE_HANDLER_S3_BUCKET variables to your .env file:

Usage

Here's a detailed example of how to use the ImageHandler class:

In this example, the resize macro is used to set the desired image dimensions, and then the createUrl method is used to generate the URL for the transformed image. The resulting URL will look something like this:

In this URL, your-cloudfront-url.com is your CloudFront distribution URL, and the long base64 string is the encoded edit options.

Using the Alias

The package also provides an alias, which you can use for even easier access. Here's an example:

In this example, ImageHandler::resize(200, 200) is equivalent to (new Rkcreative\AwsImageHandler\Services\ImageHandler())->resize(200, 200). You can use this alias anywhere in your Laravel application.

Available Macros

The ImageHandler class comes with the following macros:

You can use these macros like any other method on the ImageHandler class:

Extending with Custom Macros

You can extend the ImageHandler class with your own macros. The options are from the Sharp Node.js image processing library. Here's how to do it:

  1. Create a new service provider:

  2. In the boot method of your new service provider, add your macro:

In this example, the blur macro receives a blur value as an argument. The blur value is then added to the image handler options. The macro modifies the state of the ImageHandler instance and then returns the instance itself, allowing for method chaining.

  1. Register your new service provider in the providers array in config/app.php:

Now, you can use your macro like any other method on the ImageHandler class:

In this example, the blur macro is used to add a blur effect to the image. The blur value can be any number between 0.3 (low blur) and 1000 (maximum blur).

Contributing

Contributions are welcome. We accept contributions via Pull Requests on Github.

Bug Reports

If you've found a bug, please create an issue on Github describing the problem and include as much relevant information as you can. Screenshots, error messages, and sample code that reproduces the problem are all helpful.

Pull Requests

To run the tests, use the following command:

Happy coding!

License

The MIT License (MIT). Please see License File for more information.

Authors


All versions of aws-image-handler with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.0 || ^7.0
illuminate/support Version ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rkcreative/aws-image-handler contains the following files

Loading the files please wait ....