Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Laravel 5.x Cookbook

You're reading from   Laravel 5.x Cookbook A recipe-based book to help you efficiently create amazing PHP-based applications with Laravel 5.x

Arrow left icon
Product type Paperback
Published in Sep 2016
Publisher Packt
ISBN-13 9781786462084
Length 402 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Terry Matula Terry Matula
Author Profile Icon Terry Matula
Terry Matula
Alfred Nutile Alfred Nutile
Author Profile Icon Alfred Nutile
Alfred Nutile
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Setting Up and Installing Laravel FREE CHAPTER 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

Working with your .env file


The workflow around this can be tricky. Going from Local, to Travis CI, to CodeDeploy, and then to AWS without storing your information in .env on GitHub can be a challenge. What I will show here are some tools and techniques to do this well.

Getting ready

A base installation is fine; I will use the existing installation to show some tricks around this.

How to do it…

  1. Minimize the .env variable using Conventions as much as possible:

    1. config/queue.php I can do this to have one or more Queues:

    2. config/filesystems.php:

  2. Use the Config file as much as possible. For example, this is in my .env:

    But I can also add config/marvel.php, and then make it look like this:

    My .env file can be trimmed down by KEY=VALUES later on I can call to those:

    • Config::get('marvel.MARVEL_API_VERSION)

    • Config::get('marvel.MARVEL_API_BASE_URL')

  3. Now, to easily send to Staging or Production using the EnvDeployer library, run the following:

    >composer require alfred-nutile-inc/env-deployer:dev-master...
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 $19.99/month. Cancel anytime
Banner background image