You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test code referenced in Production code explicitly preventing models from being extended or having factories.
Order
Product
Customer
Models all define/override newFactory changing the default method signature from hasFactory, explicitly typing them to classes that are only composer PSR loaded in require-dev so don't exist in the production code base.
/** * Create a new factory instance for the model. * * @return ProductFactory */protectedstaticfunction newFactory(): ProductFactory
Causing this error in Production when trying to add or use factories.
Declaration of Illuminate\Database\Eloquent\Factories\HasFactory::newFactory() must be compatible with Corcel\WooCommerce\Model\Product::newFactory()
: Database\Factories\ProductFactory
Even when Database\Factories\ProductFactory extends Illuminate\Database\Eloquent\Factories\HasFactory
the method signature should typed to the Factory interface as the original signature is.
/**
* Create a new factory instance for the model.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory<static>
*/
protected static function newFactory()
Or the factories should be moved into the production code and namespace (or added to a namespace that doesn't explicitly conflict with every laravel application) so they can be extending and used to fulfill the parent models method signature..
The text was updated successfully, but these errors were encountered:
Test code referenced in Production code explicitly preventing models from being extended or having factories.
Order
Product
Customer
Models all define/override newFactory changing the default method signature from hasFactory, explicitly typing them to classes that are only composer PSR loaded in require-dev so don't exist in the production code base.
Causing this error in Production when trying to add or use factories.
Even when
Database\Factories\ProductFactory
extendsIlluminate\Database\Eloquent\Factories\HasFactory
the method signature should typed to the Factory interface as the original signature is.
Or the factories should be moved into the production code and namespace (or added to a namespace that doesn't explicitly conflict with every laravel application) so they can be extending and used to fulfill the parent models method signature..
The text was updated successfully, but these errors were encountered: