Skip to content

Instantly share code, notes, and snippets.

@widiarifki
Created January 3, 2020 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save widiarifki/7ce5717909f911259f9a21c9b4b07cbb to your computer and use it in GitHub Desktop.
Save widiarifki/7ce5717909f911259f9a21c9b4b07cbb to your computer and use it in GitHub Desktop.
SuitCMS - Seed user @ DatabaseSeeder
<?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