Skip to content

Instantly share code, notes, and snippets.

@dvigne
Last active March 11, 2017 17:11
Show Gist options
  • Save dvigne/cce142bcb9baf48389090ea8eb9fb726 to your computer and use it in GitHub Desktop.
Save dvigne/cce142bcb9baf48389090ea8eb9fb726 to your computer and use it in GitHub Desktop.
Check If Environment Is In Production Before Boostrapping The Rollbar Service Provider
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
if ($this->app->environment('production')) {
$this->app->register(\Jenssegers\Rollbar\RollbarServiceProvider::class);
}
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment