-
Notifications
You must be signed in to change notification settings - Fork 13
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
Model->newInstance() eror in Laravel <7.x version #8
Comments
We currently don't really have the bandwidth to support and test deprecated Laravel versions. I'm happy to merge any PRs fixing this behaviour though! /**
* Merge new casts with existing casts on the model.
*
* @param array $casts
* @return $this
*/
public function mergeCasts($casts)
{
$this->casts = array_merge($this->casts, $casts);
return $this;
} This should override the trait method if it exists, or serve as a stand-in if it doesn't. Would you be able to provide a PR with a test? |
Yes, I'll make PR after full test with Laravel 5.7 verstion, may be I could find some extra problems. |
Done: #9 |
Hey @mxdfulder I just released |
I'll consider this done for now. If there's anything lacking, please simply open a new issue 😊 |
Model->newInstance() uses $model->mergeCasts($this->casts); method from Illuminate\Database\Eloquent\Concerns\HasAttributes trait. But this method doesn't exist in that trait for Laravel version 5.x and 6.x (https://github.com/laravel/framework/blob/5.7/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php)
So any query request fails with allocating memory error.
The text was updated successfully, but these errors were encountered: