/** * Run the database seeds. * * @return void */ public function run() { foreach (Config('predefined.users') as $name => $details) { $model = new \App\User(); $model->name = $name; $model->id = $details['id']; $model->email = $details['email']; $model->password = bcrypt($details['password']); $model->created_at = \Carbon\Carbon::now(); $model->save(); isset($details['role']) ? $model->assignRole($details['role']) : $model->assignRole(Config('predefined.defaults.role')); } }