Skip to content

Feature Request: Modify values using config #82

@danielh-official

Description

@danielh-official

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');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions