Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Modify values using config #82

Open
danielh-official opened this issue May 24, 2023 · 0 comments
Open

Feature Request: Modify values using config #82

danielh-official opened this issue May 24, 2023 · 0 comments

Comments

@danielh-official
Copy link

Reason

Not all projects keep their web middleware group untouched. Some projects add extra middleware to that group which hinders the functionality of the private routes. This will allow users to easily edit the middleware for their private routes.

Request

Can we add the following code to the CypressServiceProvider::boot function?

$this->publishes([
      __DIR__.'/../config/cypress.php' => config_path('cypress.php'),
]);

Then just make a config/cypress.php file that defines the following parameters:

return [
  'routing' => [
     'middleware' => env('CYPRESS_ROUTES_MIDDLEWARE', 'web')
  ]
]

Finally, in CypressServiceProvider::addRoutes, replace it with the following code:

protected function addRoutes()
{
    Route::namespace('')
        ->middleware(config('cypress.routing.middleware'))
        ->group(__DIR__.'/routes/cypress.php');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant