diff --git a/app/Http/Controllers/Api/EmployerAnnouncementController.php b/app/Http/Controllers/Api/EmployerAnnouncementController.php index 704f66f..1f123c3 100644 --- a/app/Http/Controllers/Api/EmployerAnnouncementController.php +++ b/app/Http/Controllers/Api/EmployerAnnouncementController.php @@ -67,7 +67,8 @@ public function createAnnouncement(Request $request) $validator = Validator::make($request->all(), [ 'title' => 'required|string|max:255', - 'body' => 'required|string|max:5000', + 'body' => 'required_without:content|string|max:5000', + 'content' => 'required_without:body|string|max:5000', 'type' => 'nullable|string|in:info,warning,success', ]); @@ -80,9 +81,23 @@ public function createAnnouncement(Request $request) } try { + $bodyText = $request->body ?? $request->content; + + // Append extra event details if they are provided + $extras = []; + if ($request->event_date) $extras[] = "Date: " . $request->event_date; + if ($request->event_time) $extras[] = "Time: " . $request->event_time; + if ($request->location_details) $extras[] = "Location: " . $request->location_details; + if ($request->location_pin) $extras[] = "Map Pin: " . $request->location_pin; + if ($request->provided_items) $extras[] = "Provided: " . $request->provided_items; + + if (!empty($extras)) { + $bodyText .= "\n\n" . implode("\n", $extras); + } + $announcement = Announcement::create([ 'title' => $request->title, - 'body' => $request->body, + 'body' => $bodyText, 'type' => $request->type ?? 'info', 'employer_id' => $employer->id, ]); diff --git a/app/Http/Controllers/Api/WorkerAuthController.php b/app/Http/Controllers/Api/WorkerAuthController.php index 27c7d0c..ab89c16 100644 --- a/app/Http/Controllers/Api/WorkerAuthController.php +++ b/app/Http/Controllers/Api/WorkerAuthController.php @@ -219,7 +219,7 @@ public function setupProfile(Request $request) 'experience' => 'Not Specified', 'religion' => 'Not Specified', 'bio' => 'New worker on Migrant platform.', - 'category_id' => 7, // Default: General Helper + 'category_id' => \App\Models\WorkerCategory::where('name', 'General Helper')->value('id') ?? 1, 'verified' => false, 'status' => 'active', 'api_token' => $apiToken, @@ -342,7 +342,7 @@ public function register(Request $request) 'experience' => $request->experience ?? 'Not Specified', 'religion' => 'Not Specified', 'bio' => 'Hardworking and reliable General Helper available for immediate hire.', - 'category_id' => 7, + 'category_id' => \App\Models\WorkerCategory::where('name', 'General Helper')->value('id') ?? 1, 'verified' => false, 'status' => 'active', 'api_token' => $apiToken, diff --git a/public/uploads/documents/1779990582_passport_mds11.png b/public/uploads/documents/1779990582_passport_mds11.png new file mode 100644 index 0000000..ae18a13 Binary files /dev/null and b/public/uploads/documents/1779990582_passport_mds11.png differ diff --git a/public/uploads/documents/1779990582_visa_mds13.png b/public/uploads/documents/1779990582_visa_mds13.png new file mode 100644 index 0000000..c14d168 Binary files /dev/null and b/public/uploads/documents/1779990582_visa_mds13.png differ