laravel-review-rateable icon indicating copy to clipboard operation
laravel-review-rateable copied to clipboard

reviewable_type and reviewable_id - Column not found

Open bigperson opened this issue 2 years ago • 0 comments

$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)"

bigperson avatar Dec 22 '22 10:12 bigperson