2020-06-26 23:32:33 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Profile;
|
|
|
|
use App\User;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
|
|
|
|
class UserSeeder extends Seeder
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the database seeds.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
$staffUsers = [
|
|
|
|
|
|
|
|
[
|
|
|
|
'uuid' => 'd2b321b56ff1445db9d7794701983cad',
|
|
|
|
'name' => 'Robot 1',
|
|
|
|
'email' => 'tester1@example.com',
|
|
|
|
'username' => 'tester1',
|
|
|
|
'originalIP' => '99.18.146.235',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'uuid' => 'ab22b5da02644953ace969fce85c0819',
|
|
|
|
'name' => 'Robot 2',
|
|
|
|
'email' => 'tester2@example.com',
|
|
|
|
'username' => 'tester2',
|
|
|
|
'originalIP' => '141.239.229.53',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'uuid' => 'df38e6bf762944d3a600ded59a693ad1',
|
|
|
|
'name' => 'Robot 3',
|
|
|
|
'email' => 'tester3@example.com',
|
|
|
|
'username' => 'tester3',
|
|
|
|
'originalIP' => '25.63.20.97',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'uuid' => '689e446484824f6bad5064e3df0aaa96',
|
|
|
|
'name' => 'Robot 4',
|
|
|
|
'email' => 'tester4@example.com',
|
|
|
|
'username' => 'tester4',
|
|
|
|
'originalIP' => '220.105.223.142',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'uuid' => '172391f917bf418ab1c40ebc041ed5ba',
|
|
|
|
'name' => 'Robot 5',
|
|
|
|
'email' => 'tester5@example.com',
|
|
|
|
'username' => 'tester5',
|
|
|
|
'originalIP' => '224.66.76.60',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'uuid' => '371f34dcce2a4457bf385ab9417a2345',
|
|
|
|
'name' => 'Robot 6',
|
|
|
|
'email' => 'tester6@example.com',
|
|
|
|
'username' => 'tester6',
|
|
|
|
'originalIP' => '97.113.131.0',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'uuid' => '89aa5222855542bebe7a7780248ef5f9',
|
|
|
|
'name' => 'Robot 7',
|
|
|
|
'email' => 'tester7@example.com',
|
|
|
|
'username' => 'tester7',
|
|
|
|
'originalIP' => '15.160.137.222',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$regularUsers = [
|
|
|
|
|
|
|
|
[
|
|
|
|
'uuid' => '20f69f47e72f463493b5b91d1c05452f',
|
|
|
|
'name' => 'User 1',
|
|
|
|
'email' => 'user1@example.com',
|
|
|
|
'username' => 'user1',
|
|
|
|
'originalIP' => '253.25.237.78',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'uuid' => '5f900018241e4aaba7883f2d5c5c2357',
|
|
|
|
'name' => 'User 2',
|
|
|
|
'email' => 'user2@example.com',
|
|
|
|
'username' => 'user2',
|
|
|
|
'originalIP' => '82.92.156.176',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'uuid' => 'ba9780c3270745c6840eaabe1bf8aa14',
|
|
|
|
'name' => 'User 3',
|
|
|
|
'email' => 'user3@example.com',
|
|
|
|
'username' => 'user3',
|
|
|
|
'originalIP' => '224.123.129.17',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
|
|
|
]
|
2020-06-26 23:32:33 +00:00
|
|
|
|
|
|
|
];
|
|
|
|
|
2020-10-21 00:29:50 +00:00
|
|
|
foreach ($regularUsers as $regularUser)
|
|
|
|
{
|
2020-06-26 23:32:33 +00:00
|
|
|
$user = User::create($regularUser);
|
|
|
|
Profile::create([
|
2020-10-21 00:29:50 +00:00
|
|
|
'profileShortBio' => 'Random data ' . rand(0,1000),
|
|
|
|
'profileAboutMe' => 'Random data ' . rand(0, 1000),
|
|
|
|
'socialLinks' => "[]", // empty json set, not an array
|
2020-06-26 23:32:33 +00:00
|
|
|
'avatarPreference' => 'gravatar',
|
2020-10-21 00:29:50 +00:00
|
|
|
'userID' => $user->id
|
2020-06-26 23:32:33 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2020-10-21 00:29:50 +00:00
|
|
|
foreach($staffUsers as $staffUser)
|
|
|
|
{
|
2020-06-26 23:32:33 +00:00
|
|
|
$user = User::create($staffUser);
|
|
|
|
Profile::create([
|
2020-10-21 00:29:50 +00:00
|
|
|
'profileShortBio' => 'Random data ' . rand(0,1000),
|
|
|
|
'profileAboutMe' => 'Random data ' . rand(0, 1000),
|
|
|
|
'socialLinks' => "[]",
|
2020-06-26 23:32:33 +00:00
|
|
|
'avatarPreference' => 'gravatar',
|
2020-10-21 00:29:50 +00:00
|
|
|
'userID' => $user->id
|
2020-06-26 23:32:33 +00:00
|
|
|
]);
|
2020-10-21 00:29:50 +00:00
|
|
|
|
2020-06-26 23:32:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
User::create([
|
|
|
|
'uuid' => '6102256abd284dd7b68e4c96ef313734',
|
|
|
|
'name' => 'Admin',
|
|
|
|
'email' => 'admin@example.com',
|
|
|
|
'username' => 'admin',
|
|
|
|
'originalIP' => '192.168.1.2',
|
2020-10-21 00:29:50 +00:00
|
|
|
'password' => Hash::make('password')
|
2020-06-26 23:32:33 +00:00
|
|
|
]);
|
|
|
|
|
2020-10-21 00:29:50 +00:00
|
|
|
foreach (User::all() as $user)
|
|
|
|
{
|
2020-06-26 23:32:33 +00:00
|
|
|
$user->assignRole('reviewer', 'user');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|