Laravel Cloud is here! Zero-config managed infrastructure for Laravel apps. Deploy now.

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.


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
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Shift logo

Shift

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

Shift
Lucky Media logo

Lucky Media

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

Lucky Media
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