Refactor application submission response in ApplicationController to return JSON format and update phone number validation rule. Modify careers index view to handle new response structure.

This commit is contained in:
2025-07-29 11:38:42 +05:00
parent a627c85416
commit 330fc76ed3
2 changed files with 5 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ class ApplicationController extends Controller
'birthdate' => 'required|date',
'resume_file' => 'required|file|mimes:pdf,doc,docx|max:2048',
'email' => 'required|email|max:255',
'phone_number' => 'required|string|max:20',
'phone_number' => 'required|string',
'cover_letter' => 'nullable|string',
]);
@@ -31,6 +31,8 @@ class ApplicationController extends Controller
'cover_letter' => $validatedData['cover_letter'] ?? null,
]);
return back()->with('success', 'Your application has been submitted successfully!');
return response()->json([
'message' => 'Your application has been submitted successfully!',
]);
}
}