-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Eloquent 5.4.0 removes/breaks $connection->setFetchMode() #17728
Comments
Hi, This is documented in the Laravel 5.4 upgrade guide (Search for "Fetch Mode"). The ability to customize the fetch mode is removed and is defaulted to Event::listen(StatementPrepared::class, function ($event) {
$event->statement->setFetchMode(...);
}); Not sure how to fix it without using (more) laravel components tho. Also see #17557 |
If this is impossible (or even quite difficult) to do without additional Laravel components, then I would humbly suggest that this is not a good change. Not everybody (myself included) uses Eloquent with Laravel and the ability to easily integrate with non-Laravel codebases is an important factor for a framework like Eloquent. |
Well, the only additional component you really would need would be the event listener, but I agree it's not the most elegant solution. But the laravel team probably has a good reason to remove the option. |
Yeah, I've adapted my code to convert the resulting object to an array manually. Not as elegant but it works. Thanks :-) |
wow, closed issue, booo! |
Description:
In Eloquent 5.3.23 the following code worked:
Steps To Reproduce:
In Eloquent version 5.4.0 the above code produces the following error:
I've looked at the code and it's not quite clear to me how to achieve the previously working/supported behavior using version 5.4.0.
The text was updated successfully, but these errors were encountered: