Created
January 3, 2020 03:57
-
-
Save widiarifki/7ce5717909f911259f9a21c9b4b07cbb to your computer and use it in GitHub Desktop.
SuitCMS - Seed user @ DatabaseSeeder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Seeder; | |
use Illuminate\Support\Facades\Hash; | |
use App\Models\User; | |
class DatabaseSeeder extends Seeder | |
{ | |
/** | |
* Seed the application's database. | |
* | |
* @return void | |
*/ | |
public function run() | |
{ | |
//$this->call(FactorySeeder::class); | |
factory(User::class, 2)->make() | |
->each(function ($item, $key) { | |
factory(\App\Models\User::class, 1)->create([ | |
'group_type' => User::SUPER_ADMIN, | |
'password' => 'rahasia', | |
'username' => 'admin'.$key | |
]); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment