Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php artisan db:seed Call to undefined method AppModelsProduct::factory()

//When running: php artisan db:seed 
//Occurs de error: Call to undefined method AppModels[YOUR_MODEL_NAME]::factory()

//Fix - Add the following line to your model "use HasFactory;"
class [YOUR_MODEL_NAME] extends Model
{
    use HasFactory;
  	//...
}
 
PREVIOUS NEXT
Tagged: #php #artisan #Call #undefined #method
ADD COMMENT
Topic
Name
6+7 =