Closed netzknecht closed 1 year ago
This class is only required for unit tests, and shouldn't be called elsewhere. It's a standard Laravel technique: https://laravel.com/docs/10.x/eloquent-factories
What is the problem/use-case that you're trying to solve?
For sure, that's a common Laravel technique. But if I extend the MasterProduct
-class from the vanilo-frameworks package in my project, the hard coded factory class is not found, if I run my application tests. It can be solved by overwriting the newFactory()
-method in the inherited MasterProduct
-class of my application, but when I look to the code of the other models like Products
, MasterProductVariant
from the vanillo-framework package, the factory class isn't hard coded anywhere.
Is there any way to communicate in German language you?
How should I handle the revision of commits? Edit and push force them or create a new commit?
It can be solved by overwriting the
newFactory()
-method in the inheritedMasterProduct
-class of my application, but when I look to the code of the other models likeProducts
,MasterProductVariant
from the vanillo-framework package, the factory class isn't hard coded anywhere.
Yes, please replace it in your app if you need to. The other classes don't have these, because tests for those are using the legacy factories; a thing that will be changed soon.
Is there any way to communicate in German language you?
Yes, but only in person :) The language we use here on Github is solely English.
I think it's not right to hard code the factory here. Over and beyond, the referenced factory class is not available.