mohan #5
@ -26,7 +26,9 @@ public function reportFromWorker(Request $request)
|
||||
$validator = Validator::make($request->all(), [
|
||||
'type' => 'required|in:Chat,Review',
|
||||
'item_id' => 'required',
|
||||
'user_id' => 'nullable',
|
||||
'reason' => 'required|string|max:255',
|
||||
'others' => 'nullable|string|max:255',
|
||||
'description' => 'nullable|string|max:2000',
|
||||
]);
|
||||
|
||||
@ -90,17 +92,23 @@ public function reportFromWorker(Request $request)
|
||||
|
||||
$reportId = 'REP-' . Str::upper(Str::random(8));
|
||||
|
||||
$actualReason = $request->reason;
|
||||
if (strtolower($request->reason) === 'others' && $request->filled('others')) {
|
||||
$actualReason = 'Others: ' . $request->others;
|
||||
}
|
||||
|
||||
// Insert to moderation_reports
|
||||
DB::table('moderation_reports')->insert([
|
||||
'id' => $reportId,
|
||||
'type' => $request->type,
|
||||
'reported_user_id' => $request->user_id,
|
||||
'reported_user_name' => $reportedName,
|
||||
'reported_user_role' => $reportedRole,
|
||||
'reported_user_avatar' => $reportedAvatar,
|
||||
'reported_by_name' => $worker->name,
|
||||
'reported_by_role' => 'Worker',
|
||||
'reported_by_avatar' => null,
|
||||
'reason' => $request->reason,
|
||||
'reason' => $actualReason,
|
||||
'priority' => 'Medium',
|
||||
'status' => 'Pending',
|
||||
'description' => $request->description,
|
||||
@ -148,7 +156,9 @@ public function reportFromEmployer(Request $request)
|
||||
$validator = Validator::make($request->all(), [
|
||||
'type' => 'required|in:Chat,Review',
|
||||
'item_id' => 'required',
|
||||
'user_id' => 'nullable',
|
||||
'reason' => 'required|string|max:255',
|
||||
'others' => 'nullable|string|max:255',
|
||||
'description' => 'nullable|string|max:2000',
|
||||
]);
|
||||
|
||||
@ -212,17 +222,23 @@ public function reportFromEmployer(Request $request)
|
||||
|
||||
$reportId = 'REP-' . Str::upper(Str::random(8));
|
||||
|
||||
$actualReason = $request->reason;
|
||||
if (strtolower($request->reason) === 'others' && $request->filled('others')) {
|
||||
$actualReason = 'Others: ' . $request->others;
|
||||
}
|
||||
|
||||
// Insert to moderation_reports
|
||||
DB::table('moderation_reports')->insert([
|
||||
'id' => $reportId,
|
||||
'type' => $request->type,
|
||||
'reported_user_id' => $request->user_id,
|
||||
'reported_user_name' => $reportedName,
|
||||
'reported_user_role' => $reportedRole,
|
||||
'reported_user_avatar' => $reportedAvatar,
|
||||
'reported_by_name' => $employer->name,
|
||||
'reported_by_role' => 'Sponsor',
|
||||
'reported_by_avatar' => null,
|
||||
'reason' => $request->reason,
|
||||
'reason' => $actualReason,
|
||||
'priority' => 'Medium',
|
||||
'status' => 'Pending',
|
||||
'description' => $request->description,
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
<?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('moderation_reports', function (Blueprint $table) {
|
||||
$table->string('reported_user_id')->nullable()->after('type');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('moderation_reports', function (Blueprint $table) {
|
||||
$table->dropColumn('reported_user_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -1364,11 +1364,21 @@
|
||||
"example": "1",
|
||||
"description": "The ID of the conversation or review being reported."
|
||||
},
|
||||
"user_id": {
|
||||
"type": "string",
|
||||
"example": "5",
|
||||
"description": "Optional ID of the user being reported."
|
||||
},
|
||||
"reason": {
|
||||
"type": "string",
|
||||
"example": "Inappropriate messages",
|
||||
"example": "Others",
|
||||
"description": "The reason for submitting this report."
|
||||
},
|
||||
"others": {
|
||||
"type": "string",
|
||||
"example": "Spam and malicious links",
|
||||
"description": "Custom reason string. Used only if reason is 'Others'."
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"example": "The other party sent highly inappropriate and insulting messages.",
|
||||
@ -3049,11 +3059,21 @@
|
||||
"example": "1",
|
||||
"description": "The ID of the conversation or review being reported."
|
||||
},
|
||||
"user_id": {
|
||||
"type": "string",
|
||||
"example": "5",
|
||||
"description": "Optional ID of the user being reported."
|
||||
},
|
||||
"reason": {
|
||||
"type": "string",
|
||||
"example": "Abusive behavior",
|
||||
"example": "Others",
|
||||
"description": "The reason for submitting this report."
|
||||
},
|
||||
"others": {
|
||||
"type": "string",
|
||||
"example": "Spam and malicious links",
|
||||
"description": "Custom reason string. Used only if reason is 'Others'."
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"example": "The worker requested payments off-platform and sent abusive messages.",
|
||||
|
||||
BIN
public/uploads/documents/1780397481_passport_1000099941.jpg
Normal file
BIN
public/uploads/documents/1780397481_passport_1000099941.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
BIN
public/uploads/documents/1780902733_passport_1000100671.jpg
Normal file
BIN
public/uploads/documents/1780902733_passport_1000100671.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 262 KiB |
BIN
public/uploads/documents/1780902733_visa_1000100671.jpg
Normal file
BIN
public/uploads/documents/1780902733_visa_1000100671.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 262 KiB |
Loading…
x
Reference in New Issue
Block a user