Skip to content
New issue

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

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

Already on GitHub? # to your account

[12.x] Introducing toArray to ComponentAttributeBag class #55258

Conversation

devajmeireles
Copy link
Contributor

Being one of the most well-known methods in the framework's core, toArray is widely used when interacting with different types of instances of different classes. However, this "pattern" adopted by the framework was absent in the ComponentAttributeBag class. Therefore, with this PR, we added toArray to the ComponentAttributeBag class to assimilate the context of this class with the entire framework in general.

@taylorotwell
Copy link
Member

What does this unlock for end users?

@taylorotwell taylorotwell marked this pull request as draft April 2, 2025 17:42
@devajmeireles
Copy link
Contributor Author

What does this unlock for end users?

When it comes to end users, we consider a wide range of people, from those who have known Laravel since its launch to newcomers. For newcomers, many of them expect to find similarity of common and widely used methods, such as toArray in the ComponentAttributeBag class, even when calling $attributes->toArray() through Blade. There is nothing special about this, but it simply introduces an alternative method to all() that is not as widely known as toArray.

Copy link
Contributor

@rodrigopedra rodrigopedra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (UI doesn't let me approve)

@devajmeireles devajmeireles marked this pull request as ready for review April 2, 2025 20:41
@taylorotwell taylorotwell merged commit 9482d0e into laravel:12.x Apr 3, 2025
39 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants