Skip to content

Add method to manage withRouting options #62

@DenTray

Description

@DenTray

Description

What needs to be done?

Create a method named addRoutingOption that adds or updates named arguments inside the withRouting() call in the bootstrap/app.php file. The method should accept two parameters: a key and a value. If withRouting does not exist, it should be created. If the argument already exists in withRouting, update its value; if it does not exist, add it. It should be chainable to support calls like ->addRoutingOption('apiPrefix', '').

Expected Outcome

What is the expected result?

  • The method addRoutingOption(key, value) correctly modifies the withRouting() call in bootstrap/app.php.
  • Existing arguments are updated with the new value.
  • New arguments are added if not present.
  • The method supports chaining of multiple calls.

Verification Scenarios

How can this be tested?

  1. Call addRoutingOption('apiPrefix', '') and verify the argument is present inside withRouting().
  2. Call addRoutingOption on a file where withRouting does not yet exist and verify withRouting is created and the argument is present inside it.
  3. Call addRoutingOption twice for the same key with different values and confirm the value is updated.
  4. Ensure the method returns the instance for chaining.
  5. Check that the withRouting() call in bootstrap/app.php reflects all changes after method calls.
  6. Make sure no syntax errors or breaks occur in bootstrap/app.php after updates.


Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions