Skip to content

Conversation

jnoordsij
Copy link
Contributor

As a follow-up to #56878 and #56271, this PR updates the Model class (and Factory class) to allow passing enums for identifying connections there as well. This would allow using the same enum consistently throughout ones codebase.

* @return static
*/
public function connection(string $connection)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically this is backwards incompatible change for classes extending this class and overriding this method with a typed signature, as they would have to update theirs. I'm not sure if such cases are considered to be breaking changes; if so I can port just this change to master if preferred.

@jnoordsij jnoordsij force-pushed the model-enum-connection branch from cff647b to 3504ed6 Compare September 3, 2025 06:41
@jnoordsij jnoordsij force-pushed the model-enum-connection branch from 3504ed6 to 345aaa6 Compare September 3, 2025 06:49
@taylorotwell taylorotwell merged commit 5680b61 into laravel:12.x Sep 3, 2025
63 checks passed
@jnoordsij jnoordsij deleted the model-enum-connection branch September 3, 2025 16:48
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.

2 participants