我正在尝试遵循有关在Windows中使用命令提示符的教程。它叫做Laravel Tutorial: Step by Step Guide to Building Your First Laravel Application,我被困在种子中:
use Illuminate\Database\Seeder;
class TestingTableSeeder extends Seeder
{
public function run()
{
factory:(App\Testing::class, 5)->create();
}
}
我已经尝试过其他有关堆栈溢出问题的解决方案,但无法修复错误。
答案 0 :(得分:2)
应该是:
factory(App\Testing::class, 5)->create();
代替
factory:(App\Testing::class, 5)->create();
答案 1 :(得分:0)
您调用的工厂函数有误,请删除冒号(:),如下:
use Illuminate\Database\Seeder;
class TestingTableSeeder extends Seeder
{
public function run()
{
factory(App\Testing::class, 5)->create();
}
}