mohan #5
@ -175,6 +175,9 @@ public function setupProfile(Request $request)
|
||||
'name' => 'required|string|max:255',
|
||||
'nationality' => 'required|string|max:100',
|
||||
'language' => 'nullable|string',
|
||||
'gender' => 'nullable|string|in:male,female,other',
|
||||
'live_in_out' => 'nullable|string|in:live_in,live_out',
|
||||
'preferred_location' => 'nullable|string|max:255',
|
||||
'skills' => 'nullable|array',
|
||||
'skills.*' => 'integer|exists:skills,id',
|
||||
]);
|
||||
@ -231,6 +234,9 @@ public function setupProfile(Request $request)
|
||||
'language' => $request->language ?? 'HI', // Default to Hindi if not selected
|
||||
'password' => Hash::make(Str::random(16)), // No password at this stage
|
||||
'nationality' => $request->nationality,
|
||||
'gender' => $request->gender,
|
||||
'live_in_out' => $request->live_in_out,
|
||||
'preferred_location' => $request->preferred_location,
|
||||
'age' => 25, // Default — updated later in full profile
|
||||
'salary' => 1500, // Default AED — updated later
|
||||
'availability' => 'Immediate',
|
||||
@ -295,7 +301,9 @@ public function register(Request $request)
|
||||
'in_country' => 'nullable',
|
||||
'visa_status' => 'nullable|string|max:100',
|
||||
'preferred_job_type' => 'nullable|string|max:100',
|
||||
'live_in_out' => 'nullable|string|max:100',
|
||||
'gender' => 'nullable|string|in:male,female,other',
|
||||
'live_in_out' => 'nullable|string|in:live_in,live_out',
|
||||
'preferred_location' => 'nullable|string|max:255',
|
||||
'country' => 'nullable|string|max:100',
|
||||
'city' => 'nullable|string|max:100',
|
||||
'area' => 'nullable|string|max:100',
|
||||
@ -362,6 +370,9 @@ public function register(Request $request)
|
||||
'language' => $request->language ?? 'HI',
|
||||
'password' => Hash::make($request->password),
|
||||
'nationality' => $request->nationality ?? 'Not Specified',
|
||||
'gender' => $request->gender,
|
||||
'live_in_out' => $request->live_in_out,
|
||||
'preferred_location' => $request->preferred_location,
|
||||
'age' => $request->age ?? 25,
|
||||
'salary' => $request->salary,
|
||||
'availability' => 'Immediate',
|
||||
@ -375,7 +386,6 @@ public function register(Request $request)
|
||||
'in_country' => $inCountry,
|
||||
'visa_status' => $inCountry ? $request->visa_status : null,
|
||||
'preferred_job_type' => $request->preferred_job_type,
|
||||
'live_in_out' => $request->live_in_out,
|
||||
'country' => $request->country,
|
||||
'city' => $request->city,
|
||||
'area' => $request->area,
|
||||
|
||||
@ -64,7 +64,9 @@ public function updateProfile(Request $request)
|
||||
'in_country' => 'nullable',
|
||||
'visa_status' => 'nullable|string|max:100',
|
||||
'preferred_job_type' => 'nullable|string|max:100',
|
||||
'live_in_out' => 'nullable|string|max:100',
|
||||
'gender' => 'nullable|string|in:male,female,other',
|
||||
'live_in_out' => 'nullable|string|in:live_in,live_out',
|
||||
'preferred_location' => 'nullable|string|max:255',
|
||||
'country' => 'nullable|string|max:100',
|
||||
'city' => 'nullable|string|max:100',
|
||||
'area' => 'nullable|string|max:100',
|
||||
@ -94,7 +96,9 @@ public function updateProfile(Request $request)
|
||||
'category_id',
|
||||
'visa_status',
|
||||
'preferred_job_type',
|
||||
'gender',
|
||||
'live_in_out',
|
||||
'preferred_location',
|
||||
'country',
|
||||
'city',
|
||||
'area'
|
||||
|
||||
@ -20,6 +20,7 @@ class Worker extends Model
|
||||
'country',
|
||||
'city',
|
||||
'area',
|
||||
'preferred_location',
|
||||
'live_in_out',
|
||||
'age',
|
||||
'gender',
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('workers', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('workers', 'preferred_location')) {
|
||||
$table->string('preferred_location')->nullable()->after('area');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('workers', function (Blueprint $table) {
|
||||
$table->dropColumn('preferred_location');
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -421,14 +421,16 @@ public function test_register_with_new_api_fields()
|
||||
'salary' => 2200.50,
|
||||
'password' => 'secret123',
|
||||
'passport_file' => $fakePassport,
|
||||
'language' => 'HI, SW',
|
||||
'language' => 'HI',
|
||||
'nationality' => 'Kenya',
|
||||
'age' => 30,
|
||||
'experience' => '5 Years',
|
||||
'in_country' => 'true',
|
||||
'visa_status' => 'Tourist Visa',
|
||||
'preferred_job_type' => 'full-time',
|
||||
'live_in_out' => 'Live-out (External housing)',
|
||||
'gender' => 'male',
|
||||
'live_in_out' => 'live_out',
|
||||
'preferred_location' => 'Dubai Marina',
|
||||
'country' => 'UAE',
|
||||
'city' => 'Dubai',
|
||||
'area' => 'Marina',
|
||||
@ -442,7 +444,9 @@ public function test_register_with_new_api_fields()
|
||||
'in_country' => true,
|
||||
'visa_status' => 'Tourist Visa',
|
||||
'preferred_job_type' => 'full-time',
|
||||
'live_in_out' => 'Live-out (External housing)',
|
||||
'gender' => 'male',
|
||||
'live_in_out' => 'live_out',
|
||||
'preferred_location' => 'Dubai Marina',
|
||||
'country' => 'UAE',
|
||||
'city' => 'Dubai',
|
||||
'area' => 'Marina',
|
||||
@ -479,7 +483,9 @@ public function test_update_profile_with_new_api_fields()
|
||||
'in_country' => false,
|
||||
'visa_status' => null,
|
||||
'preferred_job_type' => 'part-time',
|
||||
'live_in_out' => 'Live-in (Stay with family)',
|
||||
'gender' => 'female',
|
||||
'live_in_out' => 'live_in',
|
||||
'preferred_location' => 'Abu Dhabi',
|
||||
'country' => 'UAE',
|
||||
'city' => 'Abu Dhabi',
|
||||
'area' => 'Khalifa City',
|
||||
@ -492,7 +498,9 @@ public function test_update_profile_with_new_api_fields()
|
||||
'in_country' => false,
|
||||
'visa_status' => null,
|
||||
'preferred_job_type' => 'part-time',
|
||||
'live_in_out' => 'Live-in (Stay with family)',
|
||||
'gender' => 'female',
|
||||
'live_in_out' => 'live_in',
|
||||
'preferred_location' => 'Abu Dhabi',
|
||||
'country' => 'UAE',
|
||||
'city' => 'Abu Dhabi',
|
||||
'area' => 'Khalifa City',
|
||||
|
||||
@ -23,7 +23,7 @@ export default defineConfig({
|
||||
port: 5173,
|
||||
cors: true,
|
||||
hmr: {
|
||||
host: '192.168.0.194',
|
||||
host: '192.168.29.131',
|
||||
},
|
||||
watch: {
|
||||
ignored: ['**/storage/framework/views/**'],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user