Skip to content

[12.x] Fix anchor links in Collections docs for consistency #10543

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

Closed

Conversation

AhmedAlaa4611
Copy link
Contributor

Description

This PR updates several anchor links in the collections.md to use kebab-case to align with the consistent format used throughout the docs. For example:

  • #method-chunkwhile → #method-chunk-while
  • #method-intersectAssoc → #method-intersect-assoc
  • #method-countBy → #method-count-by

These changes improve overall consistency in the docs, as some method anchors such as first-or-fail, first-where, and reduce-spread already follow kebab-case formatting.

@AhmedAlaa4611
Copy link
Contributor Author

I know that this may be a big PR, but I made it cautiously and reviewed it three times.

@taylorotwell
Copy link
Member

Unfortunately it would break all existing links on the web to these methods.

@AhmedAlaa4611
Copy link
Contributor Author

@taylorotwell Should we target the master branch instead?

@shaedrich
Copy link
Contributor

This would work for https://laravel.com/docs/13.x/* links but not for https://laravel.com/docs/* (version omitted, shortcut for current version) links

@AhmedAlaa4611
Copy link
Contributor Author

@shaedrich I understand you, but should we leave them not in a kebab-case forever? or there is a way to update them?

@shaedrich
Copy link
Contributor

Technically, you could probably create a redirect at https://github.com/laravel/bootcamp.laravel.com/blob/main/routes/web.php to preserve backward compatibility, but I'm not sure if Taylor would be willing to add that kind of complexity to that repository

@AhmedAlaa4611
Copy link
Contributor Author

@shaedrich

I'm not sure if Taylor would be willing to add that kind of complexity to that repository

I think that too, can we update them in all https://laravel.com/docs/*? what do you think about that?

@shaedrich
Copy link
Contributor

I'm afraid, I can't follow 🤔

@AhmedAlaa4611
Copy link
Contributor Author

I mean updating all branches with these changes.

@shaedrich
Copy link
Contributor

But the problem will remain as other sites will link here with the current version shortcut. And they won't all update their links

@AhmedAlaa4611
Copy link
Contributor Author

Maybe, but I've seen many articles that share tips or list top ten helpful methods in Laravel without referencing the official documentation. They rely solely on their own explanations, so I don't think it's a very important issue to worry about.

@shaedrich
Copy link
Contributor

That may be true. I just wanted to voice my concerns and my interpretation of Taylor's words earlier. But I don't really know the impact, it would potentially have.

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.

3 participants