I want to seed database with multiple rows with a seeder:
public function run() {
DB::table('users')->insert([
[
'name' => 'Guest',
'surname' => 'Guest',
'email' => '[email protected]',
'phone' => '+777',
'password' => bcrypt('password'),
'is_admin' => false,
],
[
'name' => 'Alexander',
'surname' => 'Jones',
'email' => '[email protected]',
'phone' => '+12321321312',
'password' => bcrypt('password'),
'is_admin' => true,
]
]);
However when i run php artisan db:seed it seeds only with the first row. How can i make seeder for multiple rows? L5.2 documentation lacks this kind of information. Please help!
use DB, can youuse App\User.. and do something likeUser::insert(). Does that work?storage/logs/laravel.log?