This commit is contained in:
2025-08-21 16:04:24 +05:45
parent 76bf4c0a18
commit 0307244399
16 changed files with 443 additions and 23 deletions

View File

@@ -47,9 +47,8 @@ class AppointmentController extends Controller
$validated = $request->validated();
$this->appointmentRepository->storeAppointmentList($validated);
toastr()->success('Appointment created successfully.');
return redirect("/thankyou")->with('success','Message Sent Successfully');
return redirect()->route('doctor_provider');
} catch (\Throwable $th) {
report($th);
toastr()->error('Something went wrong.');

View File

@@ -15,12 +15,37 @@ class CreateAppointmentRequest extends FormRequest
'team_member_id' => 'required|integer',
'full_name' => 'required|string|max:150',
'email' => 'required|email',
'contact_no' => 'required|string',
'contact_no' => ['required','nullable','regex:/^\+?\d{7,15}$/'],
'subject' => 'required|string|max:500',
'feedback' => 'required|string',
];
}
public function messages()
{
return [
'team_member_id.required' => 'The team member field is required.',
'team_member_id.integer' => 'The team member must be an integer.',
'full_name.required' => 'The full name field is required.',
'full_name.string' => 'The full name must be a string.',
'full_name.max' => 'The full name may not be greater than 150 characters.',
'email.required' => 'The email field is required.',
'email.email' => 'Invalid email format.',
'contact_no.required' => 'The contact number field is required.',
'contact_no.regex' => 'The contact number must be a valid phone number',
'subject.required' => 'The subject field is required.',
'subject.string' => 'The subject must be a string.',
'subject.max' => 'The subject may not be greater than 500 characters.',
'feedback.required' => 'The feedback field is required.',
'feedback.string' => 'The feedback must be a string.',
];
}
/**
* Determine if the user is authorized to make this request.
*/

View File

@@ -36,7 +36,7 @@ class CreateConsultationRequest extends FormRequest
'email.max' => 'The email may not be greater than :max characters.',
'contact_no.required' => 'The contact number field is required.',
'contact_no.max' => 'The contact number may not be greater than :max characters.',
'contact_no.regex' => 'The contact number must be a valid phone number',
'age_group.required' => 'The age group field is required.',
'age_group.integer' => 'The age group must be an integer.',

View File

@@ -17,7 +17,7 @@ class CreateContactUsRequest extends FormRequest
'email' => 'sometimes|nullable|email',
'subject' => 'sometimes|nullable|string|max:1000',
'message' => 'required|string|max:1000',
'phone' => 'sometimes|nullable|numeric|digits:10',
'phone' => ['sometimes','nullable','regex:/^\+?\d{7,15}$/'],
];
}
@@ -42,7 +42,8 @@ class CreateContactUsRequest extends FormRequest
'message.max' => 'The message may not be greater than 1000 characters.',
'phone.numeric' => 'The phone must be a number.',
'phone.digits' => 'The phone must be exactly 10 digits long.'
'phone.digits_between' => 'The phone must be a number between 7 and 15 digits long.',
];
}