diff --git a/config/cypress.php b/config/cypress.php new file mode 100644 index 0000000..0e28b00 --- /dev/null +++ b/config/cypress.php @@ -0,0 +1,19 @@ + env('CYPRESS_EXCLUDED_ENV', 'production'), + +]; diff --git a/src/CypressServiceProvider.php b/src/CypressServiceProvider.php index 1bdc517..b061f76 100644 --- a/src/CypressServiceProvider.php +++ b/src/CypressServiceProvider.php @@ -9,7 +9,17 @@ class CypressServiceProvider extends ServiceProvider { public function boot() { - if ($this->app->environment('production')) { + $this->mergeConfigFrom( + __DIR__.'/../config/cypress.php', 'cypress' + ); + + $excludedEnvironments = config('cypress.exclude'); + if (is_string($excludedEnvironments)) { + $excludedEnvironments = explode(',', $excludedEnvironments); + } + $excludedEnvironments[] = 'production'; + + if ($this->app->environment($excludedEnvironments)) { return; }