Skip to content
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

reviewable_type and reviewable_id - Column not found #50

Open
bigperson opened this issue Dec 22, 2022 · 0 comments
Open

reviewable_type and reviewable_id - Column not found #50

bigperson opened this issue Dec 22, 2022 · 0 comments

Comments

@bigperson
Copy link

bigperson commented Dec 22, 2022

$table->morphs('reviewrateable'); creating two fields in table
reviewrateable_type and reviewrateable_id
https://github.com/codebyray/laravel-review-rateable/blob/master/database/migrations/create_reviews_table.php.stub#L22

but in rating model use $this->morphTo(__FUNCTION__, 'reviewable_type', 'reviewable_id'); for create relation - is not identical in database table
https://github.com/codebyray/laravel-review-rateable/blob/master/src/Models/Rating.php#L35

i have the error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'reviewable_type' in 'field list' (SQL: update `reviews` set `customer_service_rating` = , `quality_rating` = , `friendly_rating` = , `price_rating` = , `recommend` = 1, `body` = ..., `approved` = 1, `reviewable_type` = App\\Models\\Contacts\\Contact, `reviewable_id` = 170, `reviews`.`updated_at` = 2022-12-22 13:31:42 where `id` = 6238)"
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

No branches or pull requests

1 participant