[10.x] Database layer fixes
This PR fixes a couple of issues discussed in #49735 .
Appropriate checks are added to Illuminate\Database\Eloquent\Relations\BelongsTo::getForeignKeyFrom() and Illuminate\Database\Query\Builder::whereIntegerInRaw() to return the proper value if a BackedEnum is encountered. This is typically the case on models where a cast has been defined, especially on keys.
I have also added a couple of tests to cover these cases where it seemed appropriate.
There might be other similar cases. Please see this comment.
Thanks for submitting a PR!
Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.
Pull requests that are abandoned in draft may be closed due to inactivity.
@taylorotwell sorry I'm confused as to why the PR was reverted to a draft. If there are any comments or suggestions I'll be happy to contribute the fixes.
@driesvints any idea what else is needed here? I'm very confused.
Hi @sidquisaad. Most likely Taylor is too busy rn to review and will review at a later moment. Thanks!
@taylorotwell gonna mark this ready for you again if that's okay.