Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions config/cypress.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

return [
/*
|--------------------------------------------------------------------------
| Excluded Environments
|--------------------------------------------------------------------------
|
| This value determines the environment(s) your application should not configure
| the cypress routes for. You may list additional environments to prevent
| from getting included with your application.
|
| Default: 'production'
| Example: 'production','staging'
*/

'exclude' => env('CYPRESS_EXCLUDED_ENV', 'production'),

];
12 changes: 11 additions & 1 deletion src/CypressServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down