Installing a Composer Package Only in Development Environment

Debugging Deployment Testing

Committed to the LaraBrain by: wjgilmore (@wjgilmore) at February 14, 2016 8:53 pm

There are plenty of useful PHP packages, however you'll often only want to install theml in your development environment

I'm using the PHP Stripe Webhook Tester package to locally test Stripe webhooks. While useful, I'm only going to ever use this package in my development and testing environments, and never on production, so there's no reason to install it on the production server. You can ensure certain packages are never installed in production as part of your deployment process by installing them using the --dev flag:

$ composer require --dev TeamTNT/php-stripe-webhook-tester 1.0.*