0
這裏是我的代碼,打算播種包括表:錯誤而laravel應用播種機
<?php
use Illuminate\Database\Seeder;
use App\Include;
class IncludesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = Faker\Factory::create();
for ($i=1; $i < 12; $i++) {
$include = [
'name' => $faker->words(2, true),
'price' => $faker->numberBetween(20000, 2000000),
'product_id' => $i,
];
Include::create($include);
}
}
}
但是當我嘗試運行通過工匠播種機我得到這個錯誤:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Parse error: syntax error, unexpected 'Include' (T_INCLUDE), expecting iden
tifier (T_STRING) or '{'
我不明白什麼是缺少的,請有任何想法的人!
使用受保護的$ table =「tablename」;在Includes.php – RamAnji