Replies: 3 comments
-
adding |
Beta Was this translation helpful? Give feedback.
-
Actually, homework is uncountable and thus there is no "homeworks". Nevertheless if it was "fixed" to not produce a pluralized form it would be a breakage. |
Beta Was this translation helpful? Give feedback.
-
Moved to discussions |
Beta Was this translation helpful? Give feedback.
-
Description:
Things first, first. My webapp worked GREAT before updating.
The conflicting piece of code?
$results = Subject::with(['user'])->where('user_id', $user_id)->withCount('homeworks');
Why is laravel now asking for a table called
homework
when I'm literally trying to pull one calledhomeworks
?Base table or view not found: 1146 Table 'homewrk.homework'` (homewrk is the database name).
Steps To Reproduce:
Create a table named in plural (idk, something like products), create a relationship to the user, and then inside the product, make another table called (again) something in plural, such as
characteristics
. Then try to show the products and the number of characteristics they have though the line of code I gave:$results = Product::with(['user'])->where('user_id', $user_id)->withCount('characteristics');
It used to work, now it does not. I cannot even do
$subject->homeworks->count()
either.Beta Was this translation helpful? Give feedback.
All reactions