Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Laravel 5.x Cookbook

You're reading from  Laravel 5.x Cookbook

Product type Book
Published in Sep 2016
Publisher Packt
ISBN-13 9781786462084
Pages 402 pages
Edition 1st Edition
Languages
Authors (2):
Terry Matula Terry Matula
Profile icon Terry Matula
Alfred Nutile Alfred Nutile
Profile icon Alfred Nutile
View More author details

Table of Contents (17) Chapters

Laravel 5.x Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Setting Up and Installing Laravel 2. Using Composer Packages 3. Routing 4. Building Views and Adding Style 5. Working with Data 6. Adding Angular to Your App 7. Authentication, Security, and Subscriptions 8. Testing and Debugging Your Application 9. Adding Advanced Features to Your App 10. Deploying Your App Index

Saving files to S3


With the previous recipe, I covered how to upload and save files. I will show how easy it is to get those onto S3. By the time we are done, we will have our files uploaded to S3 and when needed for testing our app will deal with the local switch for us. I will show this both at the upload level and the view level.

Getting ready

If you did the previous recipe, you will have the basic classes you need to make this happen. Also, you need to make an S3 bucket on AWS. I will cover this a bit but read more on their website, since doing this right is a skill and you should not be using your AWS key and AWS secret in your app. You should use a set made for the app; for a user you make just for this app.

How to do it…

  1. We need a bucket! Log into AWS and make a user. Then download the API key and secret you get with that user:

  2. Save those to your local machine and enter them like this into your .env file, making sure to match the key name just as it is here:

  3. Now update your config/filesystems...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}