From 2f97702998ec629c76ab2bcbb77a42d50bab4450 Mon Sep 17 00:00:00 2001 From: daydevelops Date: Mon, 21 Oct 2019 10:30:12 -0230 Subject: [PATCH] moved admin credentials to .env file from seeder --- .env.example | 4 ++++ config/blog.php | 5 +++++ database/seeds/UsersTableSeeder.php | 6 +++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 0b7d6e023..800bf8c9d 100644 --- a/.env.example +++ b/.env.example @@ -30,6 +30,10 @@ MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null +ADMIN_NAME= +ADMIN_EMAIL= +ADMIN_PASSWORD= + AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-east-1 diff --git a/config/blog.php b/config/blog.php index a7a18f32d..0c12d795e 100644 --- a/config/blog.php +++ b/config/blog.php @@ -8,6 +8,11 @@ // Super Admin 'super_admin' => env('APP_SUPER_ADMIN') ?: 1, + // Admin Credentials + 'admin_name' => env('ADMIN_NAME') ?: 'admin', + 'admin_email' => env('ADMIN_EMAIL') ?: 'admin@pigjian.com', + 'admin_password' => env('ADMIN_PASSWORD') ?: 'admin', + // Default Avatar 'default_avatar' => env('DEFAULT_AVATAR') ?: '/images/default.png', diff --git a/database/seeds/UsersTableSeeder.php b/database/seeds/UsersTableSeeder.php index c8d7c5a5e..1b10452b4 100644 --- a/database/seeds/UsersTableSeeder.php +++ b/database/seeds/UsersTableSeeder.php @@ -15,9 +15,9 @@ public function run() { $users = [ [ - 'name' => 'admin', - 'email' => 'admin@pigjian.com', - 'password' => Hash::make('admin'), + 'name' => config('blog.admin_name'), + 'email' => config('blog.admin_email'), + 'password' => Hash::make(config('blog.admin_password')), 'status' => true, 'is_admin' => true, 'confirm_code' => str_random(64),