Skip to content
Snippets Groups Projects
Commit 726482f4 authored by Wildan Dicky Alnatara's avatar Wildan Dicky Alnatara
Browse files

adding user seed

parent dca7b84b
Branches
No related merge requests found
Pipeline #6059 failed with stage
......@@ -28,8 +28,13 @@
6. Run `php artisan key:generate`
7. Run `php artisan config:cache`
9. Run `php artisan migrate`
10. Run `npm run production`
11. Please make sure that your web server already configured to `public/` folder
10. jangan lupa run `npm i`
11. Run `npm run production`
12. Please make sure that your web server already configured to `public/` folder
### User Seeding
`php artisan db:seed --class=UsersVariantTableSeeder`
### Developers:
1. Kanisius Kenneth Halim (13515008)
......
......@@ -17,7 +17,9 @@ $factory->define(App\User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'username' => $faker->unique()->userName,
'phone' => $faker->phoneNumber,
'password' => bcrypt('secret'), // secret
'remember_token' => str_random(10),
];
});
<?php
use Illuminate\Database\Seeder;
class UsersVariantTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$user = App\User::create([
'name' => 'Wildan Dicky Alnatara',
'email' => 'alnataraw@gmail.com',
'username' => 'wildanganteng',
'phone' => '081530058444',
'password' => bcrypt('secret'), // secret
'remember_token' => str_random(10),
]);
$manajer = App\Manajer::create([
'id' => $user->id,
]);
$users = factory(App\User::class, 6)->create();
for ($x = 0; $x < 3; $x++) {
$manajer = App\Manajer::create([
'id' => $users[$x]->id,
]);
}
for ($x = 3; $x < 6; $x++) {
$dosen = App\Dosen::create([
'id' => $users[$x]->id,
'status' => 0
]);
}
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment