I\'m currently trying to seed my users table. If I try it like this with 2 rows, it fails. It works fine if I just use a single array instead of the 2 arrays inside the $users a
This works, even for Laravel 5.3
get()->count() == 0){
DB::table('users')->insert([
[
'name' => 'Administrator',
'email' => 'admin@app.com',
'password' => bcrypt('password'),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
],
[
'name' => 'Agency',
'email' => 'agency@app.com',
'password' => bcrypt('password'),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
],
[
'name' => 'End',
'email' => 'endcustomer@app.com',
'password' => bcrypt('password'),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]
]);
} else { echo "\e[31mTable is not empty, therefore NOT "; }
}
}