テーブルに偽のレコードを挿入していますが、データベースに移動していません。あなたは以下の私のコードを確認することができます -laravelにクエリを挿入します。
public function up()
{
Schema::create('employees', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email',255)->unique();
$table->string('contact_number');
$table->timestamps();
});
$faker = Faker\Factory::create();
$limit = 33;
for ($i = 0; $i < $limit; $i++) {
DB::table('employees')->insert([
'name' => $faker->name,
'email' => $faker->unique()->email,
'contact_number' => $faker->phoneNumber,
]);
}
}
を私が間違っているところ誰も教えてもらえますか?これで私を助けてください。
Database: Seedingdetailіは、私は、このしかし、誰成功を試してみました。 –
シーダーコードを投稿してください。 –
パブリック関数run() { $ faker = Faker \ Factory :: create(); $ limit = 33; 'name' => $ faker-> name、 'email'のように、DB :: table( 'employees') - > insert($ i = 0; $ i <$ limit; $ i ++) => $ faker-> unique() - > email、 'contact_number' => $ faker-> phoneNumber、 ]); } } –