1. Go to this page and download the library: Download stechstudio/aws-events 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/ */
stechstudio / aws-events example snippets
function lambda(string $event, string $context): array
{
$event = Event::fromJson($event);
Log::info('I got your event!');
foreach ($event as $key => $value) {
Log::info(sprintf('%s => %s', $key, $value));
}
Log::info('And here is the context.');
$context = Context::fromJson($context)
foreach ($context->toArray() as $key => $value) {
Log::info(sprintf('%s => %s', $key, $value));
}
Log::info('I will just echo it back to you.');
return $event->toArray();
}