diff --git a/database/seeds/UsersTableSeeder.php b/database/seeds/UsersTableSeeder.php index fdbf1e0..503c559 100644 --- a/database/seeds/UsersTableSeeder.php +++ b/database/seeds/UsersTableSeeder.php @@ -11,13 +11,14 @@ class UsersTableSeeder extends Seeder */ public function run() { + $random_password = $this->generatePassword(); DB::table('users')->insert([ 'id' => 1, 'firstName' => 'Admin', 'lastName' => 'Doe', 'email' => 'admin@mail.com', 'role' => 'admin', - 'password' => bcrypt('ebQcv4Z2-LCYM^tR') + 'password' => bcrypt($random_password) ]); /* DB::table('users')->insert([ 'id' => 2, @@ -28,4 +29,11 @@ public function run() 'password' => bcrypt('123456') ]); */ } + private function generatePassword() { + $random_password = str_random(10); + if (isset($this->command)) { + $this->command->getOutput()->writeln("Password for admin : $random_password"); + } + return $random_password; + } }