📌  相关文章
📜  php artisan db:seed 调用未定义的方法 App\Models\Product::factory() - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:46.843000             🧑  作者: Mango

代码示例1
//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;
      //...
}