File: /mnt/data/ghayatcom/ghayatcom-api/database/seeders/UserSeeder.php
<?php
namespace Database\Seeders;
use App\User;
use App\UserSettingsNotification;
// use Illuminate\Support\Facades\Hash;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
class UserSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$datas = [
1 => [
'type' => 'super_admin',
'first_name' => config('app.name'),
'last_name' => 'Admin',
'email' => '[email protected]',
'mobile_number' => '07876543210',
'is_mobile_number_verified' => '1',
'email_verification_code' => '123456',
'is_email_verified' => '1',
'two_step_verification_type' => '1',
'is_two_step_verified' => '1',
'password' => Hash::make('123456'),
'passcode' => Hash::make('1234'),
'status' => '2',
'country_id' => 233,
'country_code' => 1,
'created_by' => 1,
],
2 => [
'type' => 'patient',
'first_name' => 'patient',
'last_name' => 'p',
'email' => '[email protected]',
'mobile_number' => '07876543219',
'is_mobile_number_verified' => '1',
'email_verification_code' => '123456',
'is_email_verified' => '1',
'two_step_verification_type' => '1',
'is_two_step_verified' => '1',
'dob' => date('Y-m-d', strtotime('1996-11-11')),
'post_code' => '600008',
'address' => 'Test address',
'password' => Hash::make('123456'),
'passcode' => Hash::make('1234'),
'unique_id' => '000001',
'status' => '2',
'country_id' => 233,
'country_code' => 1,
'created_by' => 1,
],
3 => [
'type' => 'doctor',
'first_name' => 'doctor',
'last_name' => 'd',
'passport_number' => '7700225VG',
'email' => '[email protected]',
'mobile_number' => '07876543211',
'is_mobile_number_verified' => '1',
'email_verification_code' => '123456',
'is_email_verified' => '1',
'two_step_verification_type' => '1',
'is_two_step_verified' => '1',
'dob' => date('Y-m-d', strtotime('1996-11-11')),
'post_code' => '600008',
'address' => 'Test address',
'password' => Hash::make('123456'),
'passcode' => Hash::make('1234'),
'status' => '2',
'country_id' => 233,
'country_code' => 1,
'created_by' => 1,
],
4 => [
'type' => 'pharmacy_admin',
'first_name' => 'pharmacy',
'last_name' => 'admin',
'passport_number' => '7700225VL',
'email' => '[email protected]',
'mobile_number' => '07876543214',
'is_mobile_number_verified' => '1',
'email_verification_code' => '123456',
'is_email_verified' => '1',
'two_step_verification_type' => '1',
'is_two_step_verified' => '1',
'dob' => date('Y-m-d', strtotime('1996-11-11')),
'post_code' => '600008',
'address' => 'Test address',
'password' => Hash::make('123456'),
'passcode' => Hash::make('1234'),
'status' => '2',
'country_id' => 233,
'country_code' => 1,
'created_by' => 1,
],
5 => [
'type' => 'pharmacy',
'first_name' => 'pharmacist',
'last_name' => 'M',
'passport_number' => '7700225VA',
'email' => '[email protected]',
'mobile_number' => '07876543299',
'is_mobile_number_verified' => '1',
'email_verification_code' => '123456',
'is_email_verified' => '1',
'two_step_verification_type' => '1',
'is_two_step_verified' => '1',
'dob' => date('Y-m-d', strtotime('1996-11-11')),
'post_code' => '600008',
'address' => 'Test address',
'password' => Hash::make('123456'),
'passcode' => Hash::make('1234'),
'status' => '2',
'country_id' => 233,
'country_code' => 1,
'created_by' => 1,
],
6 => [
'type' => 'clinic_admin',
'first_name' => 'Clinic',
'last_name' => 'User',
'passport_number' => '7700229VA',
'email' => '[email protected]',
'mobile_number' => '0787654321',
'is_mobile_number_verified' => '1',
'email_verification_code' => '123456',
'is_email_verified' => '1',
'two_step_verification_type' => '1',
'is_two_step_verified' => '1',
'dob' => date('Y-m-d', strtotime('1996-11-11')),
'post_code' => '600008',
'address' => 'Test address',
'password' => Hash::make('123456'),
'passcode' => Hash::make('1234'),
'status' => '2',
'country_id' => 233,
'country_code' => 1,
'created_by' => 1,
],
];
foreach ($datas as $id => $data) {
$row = User::firstOrNew([
'id' => $id,
]);
$row->fill($data);
$row->save();
UserSettingsNotification::create(['user_id' => $id]);
}
}
}