You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.0 KiB
59 lines
2.0 KiB
<?php |
|
|
|
namespace Database\Seeders; |
|
|
|
use App\Models\User; |
|
// use Faker\Provider\Uuid; |
|
use Ramsey\Uuid\Uuid; |
|
use Illuminate\Database\Seeder; |
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents; |
|
|
|
class UserSeeder extends Seeder |
|
{ |
|
/** |
|
* Run the database seeds. |
|
*/ |
|
public function run(): void |
|
{ |
|
User::create([ |
|
'username' => 'admin', |
|
'fullname' => 'Admin System', |
|
'nip' => '1234567890123456', |
|
'email' => 'admin@gmail.com', |
|
'no_hp' => '085159079010', |
|
'divisi' => 'Admin Division', |
|
'tgl_lahir' => '1990-01-01', |
|
'jenis_kelamin' => 'Laki-laki', |
|
'agama' => 'Islam', |
|
'foto' => '', // Ganti dengan nama berkas foto jika diperlukan |
|
'role_id' => 'd961ad96-211b-4f68-9ff2-111111111111', // Menghasilkan UUID versi 4 |
|
'warehouse_id' => 'd961ad96-211b-4f68-9ff2-111111111111', // Menghasilkan UUID versi 4 |
|
'address' => 'Jalan Ciwatu', |
|
'email_verified_at' => now(), |
|
'password' => bcrypt('admin'), |
|
'created_by' => 'Seeder', |
|
'updated_by' => 'Seeder', |
|
]); |
|
|
|
// User lainnya |
|
User::create([ |
|
'username' => 'Operator', |
|
'fullname' => 'Operator System', |
|
'nip' => '6543210987654321', |
|
'email' => 'operator@gmail.com', |
|
'no_hp' => '087779767603', |
|
'divisi' => 'Operator Gudang', |
|
'tgl_lahir' => '1985-05-15', |
|
'jenis_kelamin' => 'Perempuan', |
|
'agama' => 'Islam', |
|
'foto' => '', // Ganti dengan nama berkas foto jika diperlukan |
|
'role_id' => 'a5c7b207-1a1c-43b8-89bf-222222222222', // Menghasilkan UUID versi 4 |
|
'warehouse_id' => 'a5c7b207-1a1c-43b8-89bf-222222222222', // Menghasilkan UUID versi 4 |
|
'address' => 'Jalan Gelarmendala', |
|
'email_verified_at' => now(), |
|
'password' => bcrypt('operator'), |
|
'created_by' => 'Seeder', |
|
'updated_by' => 'Seeder', |
|
]); |
|
} |
|
}
|
|
|