Answers for "call to undefined function database seeders factory() in laravel 8"

PHP
1

php artisan db:seed Call to undefined method App\Models\Product::factory()

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

//Fix - Add the following line to your model "use HasFactory;"
class [YOUR_MODEL_NAME] extends Model
{
    use HasFactory;
  	//...
}
Posted by: Guest on July-01-2021

Code answers related to "call to undefined function database seeders factory() in laravel 8"

Browse Popular Code Answers by Language