Skip to content

rinsaka/laravel-aws-s3

Repository files navigation

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as:

Laravel is accessible, yet powerful, providing tools needed for large, robust applications.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework, making it a breeze to get started learning the framework.

If you're not in the mood to read, Laracasts contains over 1100 video tutorials on a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for helping fund on-going Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page:

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

S3 を使う

S3用のIAMを作成する

  • 「セキュリティ資格情報」を開く

-「ユーザー」を開く

-「ユーザーを追加」を開く

-「ユーザー名」を入力し,「プログラムによるアクセス」にチェックを入れる.「次のステップ」をクリック

  • 「既存のポリシーを直接アタッチ」を選び,ポリシー名から「AmazonS3FullAccess」にチェックを入れる.「次のステップ」をクリック

  • タグの追加で「キー」と「値」を適当に入れる.「次のステップ」をクリック.

  • ユーザーを追加:内容を確認する.「ユーザーの作成」をクリック.

  • ユーザーを追加(成功):アクセスキーIDとシークレットアクセスキーが発行されるので,これを控えておく.また.csvファイルもダウンロードする.

パッケージのインストール

[vagrant@localhost laravel-aws-s3]$ php ../composer.phar require league/flysystem-aws-s3-v3

.env に設定を追加する

AWS_ACCESS_KEY_ID=Access key ID
AWS_SECRET_ACCESS_KEY=Secret access key
AWS_DEFAULT_REGION=ap-northeast-1
AWS_BUCKET=bucket name

S3 でのアクセス権の設定

  • S3 におけるファイルのアクセス権は変更する必要はない
  • つまり「パブリックアクセスをすべてブロック」でよい
  • これにより,URLがわかっただけではファイルの閲覧ができない
  • URL に署名をつけることでようやくアクセスできるようになり,その署名には有効期限も設定される

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published