initial: bootstrap from BukidBountyApp base

This commit is contained in:
Jonathan Sykes
2026-06-06 18:43:00 +08:00
commit eb4a5731fb
5674 changed files with 160857 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
use App\Models\User;
use App\Models\Market\UserInfo;
use Hyperf\Database\Seeders\Seeder;
use Hypervel\Support\Str;
class UpdateUserInfoSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// Find or create the test user Rex Moran Loba
$user = User::where('email', 'rexm.loba@gmail.com')->first();
if (!$user) {
$user = User::create([
'hashkey' => Str::random(64),
'name' => 'Rex Loba',
'fullname' => 'Rex Moran Loba',
'email' => 'rexm.loba@gmail.com',
'mobile_number' => '09123456789',
'username' => 'rexl',
'password' => 'password', // Hash should be handled by model or manually if not
'acct_type' => 'user',
'active' => true,
]);
}
$userInfo = UserInfo::where('user_id', $user->id)->first();
if (!$userInfo) {
$userInfo = new UserInfo([
'user_id' => $user->id,
'hashkey' => Str::random(64),
]);
}
$userInfo->fill([
'firstname' => 'Rex Moran',
'lastname' => 'Loba',
'fullname' => 'Rex Moran Loba',
'email' => 'rexm.loba@gmail.com',
'mobile' => '09123456789',
'civil_status' => 'Single',
'education_level' => 'Bachelor\'s Degree',
'livelihood_source' => 'Software Development',
'is_active' => true,
]);
$userInfo->save();
}
}