Can't seed if there is empty table in the exporter.
irman opened this issue · 2 comments
irman commented
For example:
class myprojectTableSeeder extends Seeder {
public function run()
{
DB::table('assigned_roles')->insert(
);DB::table('password_reminders')->insert(
);DB::table('permission_role')->insert(
);DB::table('permissions')->insert(
);
DB::table('roles')->insert(array(
array(
'id' => 1,
'name' => 'Admin',
'created_at' => '2014-08-11 11:00:00',
'updated_at' => '2014-08-11 11:00:00',
),
array(
'id' => 2,
'name' => 'User',
'created_at' => '2014-08-11 11:00:00',
'updated_at' => '2014-08-11 11:00:00',
),
));DB::table('users')->insert(
);
}
}
Won't work as this error will appeared:
[ErrorException] Argument 1 passed to Illuminate\Database\Query\Builder::insert() must be of the type array, none given, called in D:\Projects\myprojectTableSeeder.php on line 8 and defined
Please fix it, maybe just remove the line entirely when the table is empty.
nWidart commented
Will do as soon as I'm back from holiday. (coming weekend)
irman commented
Thanks!