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

Make Prefix attribute repeatable #152

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eabay
Copy link

@eabay eabay commented Jan 8, 2025

Mark the Prefix attribute as repeatable and update the ClassRouteAttributes class to support multiple prefixes.

  • Prefix Attribute:

    • Mark the Prefix attribute in src/Attributes/Prefix.php as repeatable by adding Attribute::IS_REPEATABLE.
  • ClassRouteAttributes:

    • Update the prefix method in src/ClassRouteAttributes.php to return an array of prefixes.
    • Update the groups method in src/ClassRouteAttributes.php to handle multiple prefixes.
  • Tests:

    • Add a test for multiple prefixes in tests/AttributeTests/PrefixAttributeTest.php.
    • Add multiple Prefix attributes to the PrefixTestController class in tests/TestClasses/Controllers/PrefixTestController.php.

For more details, open the Copilot Workspace session.

Mark the `Prefix` attribute as repeatable and update the `ClassRouteAttributes` class to support multiple prefixes.

* **Prefix Attribute**:
  - Mark the `Prefix` attribute in `src/Attributes/Prefix.php` as repeatable by adding `Attribute::IS_REPEATABLE`.

* **ClassRouteAttributes**:
  - Update the `prefix` method in `src/ClassRouteAttributes.php` to return an array of prefixes.
  - Update the `groups` method in `src/ClassRouteAttributes.php` to handle multiple prefixes.

* **Tests**:
  - Add a test for multiple prefixes in `tests/AttributeTests/PrefixAttributeTest.php`.
  - Add multiple `Prefix` attributes to the `PrefixTestController` class in `tests/TestClasses/Controllers/PrefixTestController.php`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/spatie/laravel-route-attributes?shareId=XXXX-XXXX-XXXX-XXXX).
@eabay eabay marked this pull request as draft January 8, 2025 14:06
@eabay
Copy link
Author

eabay commented Jan 8, 2025

I took a shot at getting this feature with the help of Copilot Workspace. It worked pretty well, although a few tests didn't pass.

Leaving it open to take another try when I have time.

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

Successfully merging this pull request may close these issues.

1 participant