Download the PHP package intouch/laravel-aws-lambda without Composer

On this page you can find all versions of the php package intouch/laravel-aws-lambda. 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 laravel-aws-lambda

Laravel AWS Lambda

Latest Version on Packagist Build Status Coveralls StyleCI Total Downloads

This package adds support to run Laravel in AWS Lambda.

Contents

Installation

  1. First, install the package via composer:

  2. On versions of Laravel less than 5.5, you'll want to register the service provider. Add Intouch\LaravelAwsLambda\LambdaServiceProvider::class, to the providers array in config/app.php.

  3. Install the provided files in your application:

Advanced Installation Notes

Usage

You'll need to run this in a Lambda runtime which supports executing php. See aws-lambda-runtime-php, which is the runtime we use for testing and development of the package.

Once the package is installed, upload your built Laravel application to AWS Lambda as a function. Specify the Handler as handler.handler; this will load the published handler.php which was provided at the root of your application, and then invoke the handler() entrypoint into the package, which will bootstrap your application.

Currently the package supports events from two AWS data sources:

Additionally, you may invoke the lambda (manually, or via CloudWatch events) with a custom JSON payload specifying an artisan command to be run.

API Gateway Usage

Register a route (single route, or {proxy+}) which is configured as a LAMBDA_PROXY route passing the request through to your lambda function.

The Laravel AWS Lambda package will pass the API Gateway request through the HTTP Kernel, thus following your normal application routing. The response object will then be converted to a valid LAMBDA_PROXY response, and returned to the caller.

SQS Usage

Configure an SQS queue to deliver messages to the AWS Lambda function. There is no need to configure or run a listener; the lambda will be invoked on demand when a message is delivered to the queue. It is recommended that you configure the batch size to 1.

Publish a valid Laravel queue message via the Laravel SQS Queue driver.

The Lambda will be invoked, the package will process the received message, and instantiate your job class as per normal.

Notes about running SQS jobs via AWS Lambda

When running SQS jobs via Lambda, it is Lambda that is responsible for executing the DeleteMessage call against SQS after successful execution. This occurs when the Lambda execution exits successfully.

If you configure Lambda to invoke with a batch size that is not one, multiple jobs may be passed through to the Lambda invocation. The Laravel AWS Lambda package will handle this for you by running each job in series. However, if any job encounters a failure, all jobs in the batch will be failed and retried by Lambda.

Running multiple jobs per batch is supported, and should permit higher throughput, but you should be aware of the possible consequences, and ensure your application is designed to handle multiple executions of already-run-jobs.

Running an Artisan command

You can pass a custom payload through to the Lambda to run an Artisan command:

The above sample payload will invoke the inspire command. You can use custom payloads such as this either via manual invocation during process automations, or as scheduled executions via CloudWatch Events in place of commands you would typically run via the Artisan Scheduler.

Extending

The Larvel AWS Lambda package reads an array of Handlers from configuration specified in config/aws-lambda.php. You may add your own custom handlers to this list, if desired.

Handlers are passed the $payload of the lambda invocation when they are being created.

Next, in a loop, each Handler is evaluated by calling the canHandle() method. Your handler should examine the payload, and determine if this is a job that should be handled by this handler.

When a handler returns true to the canHandle() check, it's handle() method is called. You may type-hint dependencies in the handle() method and they will be injected by the IoC while calling the method, similar to how Controllers, Jobs, and other invocations work in Laravel.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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


All versions of laravel-aws-lambda with dependencies

PHP Build Version
Package Version
Requires ext-json Version ^1.4
illuminate/support Version >5.1.0 <5.8
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 intouch/laravel-aws-lambda contains the following files

Loading the files please wait ....