/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); // Add default admin user if (!User::exists()) { User::create(['name' => 'DF Admin', 'email' => 'dfadmin@' . gethostname() . '.com', 'password' => 'Dream123!', 'is_sys_admin' => true, 'is_active' => true]); $this->command->info('Admin user seeded!'); } }
/** * This method is used for staging the overall * test environment. Which usually covers things like * running database migrations and seeders. * * In order to override and run this method on a child * class, you must set the static::$staged property to * false in the respective child class. */ public function stage() { Artisan::call('migrate'); Artisan::call('db:seed'); Model::unguard(); // Add default admin user if (!User::exists()) { User::create(['name' => 'DF Admin', 'email' => '*****@*****.**', 'password' => 'Dream123!', 'is_sys_admin' => true, 'is_active' => true]); } }