We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In Laravel 11.19 (https://github.com/laravel/framework/releases/tag/v11.19.0) this PR was added:
laravel/framework#52227
This causes this query:
$snapshot = $this->snapshot ->newQuery() ->whereMorphedTo($this->snapshot->subject(), $this->model->getMorphClass()) ->latest() ->first();
To result in this SQL:
select * from `model_snapshots` where `related_table`.`subject_type` = ? order by `created_at` desc
Instead of
select * from `model_snapshots` where `subject_type` = ? order by `created_at` desc
Basically it looks for subject_type on the related_table instead of on the model_snapshots table.
subject_type
I'm not entirely sure why this is happening.. perhaps the whereMorphedTo method is the wrong method to use here?
whereMorphedTo
Any chance you could fix this query so that it explicitly looks for subject_type to avoid this issue?
Something like this perhaps
$snapshot = $this->snapshot ->newQuery() ->where(function ($query) { $query->where('subject_type', $this->model->getMorphClass()); }) ->latest() ->first();
Many thanks!
The text was updated successfully, but these errors were encountered:
Hi. Thanks for info. I will fix this soon.
Cheers!
Sorry, something went wrong.
This should be fixed now ;)
Yay awesome thank you!
No branches or pull requests
In Laravel 11.19 (https://github.com/laravel/framework/releases/tag/v11.19.0) this PR was added:
laravel/framework#52227
This causes this query:
To result in this SQL:
Instead of
Basically it looks for
subject_type
on the related_table instead of on the model_snapshots table.I'm not entirely sure why this is happening.. perhaps the
whereMorphedTo
method is the wrong method to use here?Any chance you could fix this query so that it explicitly looks for
subject_type
to avoid this issue?Something like this perhaps
Many thanks!
The text was updated successfully, but these errors were encountered: