Tinkerwell - The PHP Scratchpad

Aws Sdk Php Laravel

aws/aws-sdk-php-laravel image

Aws Sdk Php Laravel stats

Downloads
20.4M
Stars
1,590
Open Issues
9
Forks
283

View on GitHub →

A simple Laravel 5/6/7/8/9 service provider for including the AWS SDK for PHP.

AWS SDK PHP Laravel Package Summary

The AWS SDK PHP Laravel package provides a simple and efficient way to integrate the AWS SDK into Laravel and Lumen applications, supporting a wide range of Laravel versions from 5.1 to 10.0. The package offers a Laravel service provider to include the official AWS SDK for PHP, simplifying the interaction with AWS services.

Key Features

  • Compatibility: Supports Laravel versions 5.1 to 10.0.
  • Ease of Installation: Can be installed via Composer.
  • Automatic Configuration: Utilizes environment variables for hassle-free setup.
  • Facilitates AWS Service Operations: Simplifies tasks like uploading files to S3 using Laravel's service container or the AWS facade.

Installation

Install the package using Composer:

composer require aws/aws-sdk-php-laravel:~3.0

For Laravel, add the service provider and facade alias in config/app.php:

'providers' => [
Aws\Laravel\AwsServiceProvider::class,
// other providers
];
 
'aliases' => [
'AWS' => Aws\Laravel\AwsFacade::class,
// other aliases
];

For Lumen, register the service provider in bootstrap/app.php:

$app->register(Aws\Laravel\AwsServiceProvider::class);

Configuration

The package uses three main environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_REGION. To customize these settings, publish the configuration file:

php artisan vendor:publish --provider="Aws\Laravel\AwsServiceProvider"

Modify the settings in the published config/aws.php.

Usage

Retrieve the AWS client from the Laravel service container and perform operations like:

$s3 = App::make('aws')->createClient('s3');
$s3->putObject([
'Bucket' => 'YOUR_BUCKET',
'Key' => 'YOUR_OBJECT_KEY',
'SourceFile' => '/path/to/your/file.ext',
]);

Or use the AWS facade:

$s3 = AWS::createClient('s3');
$s3->putObject([...]);

Getting Help

For support, you can ask questions on StackOverflow with the aws-php-sdk tag, join the AWS SDK for PHP Gitter community, or open a support ticket with AWS Support. For bugs and feature requests, open an issue on the GitHub repository.

Contributing

Contributions are welcome. Review the contributing guidelines before submitting issues or pull requests.

This package is a practical choice for Laravel developers looking to leverage AWS services effectively, providing a robust toolset facilitated by the AWS SDK for PHP.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Aws Aws Sdk Php Laravel Related Articles

AWS Developer Center for PHP image

AWS Developer Center for PHP

Read article
Forward Laravel Logs to Amazon Kinesis image

Forward Laravel Logs to Amazon Kinesis

Read article
Things I Didn't Know About SQS image

Things I Didn't Know About SQS

Read article
Using the AWS PHP SDK image

Using the AWS PHP SDK

Read article
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech