|
|
|
@ -73,11 +73,10 @@ class AppointmentController extends Controller |
|
|
|
|
'date' => 'required|date', |
|
|
|
|
'start_time' => 'required|date_format:H:i', |
|
|
|
|
'end_time' => 'required|date_format:H:i', |
|
|
|
|
// 'location' => 'required|max:255', |
|
|
|
|
// 'description' => 'required', |
|
|
|
|
]); |
|
|
|
|
$start_time = Carbon::createFromFormat('H:i', $request->get('start_time'))->format('H:i A'); |
|
|
|
|
$end_time = Carbon::createFromFormat('H:i', $request->get('end_time'))->format('H:i A'); |
|
|
|
|
|
|
|
|
|
$appointment = new Appointment([ |
|
|
|
|
'date' => $request->get('date'), |
|
|
|
|
'start_time' => $start_time, |
|
|
|
@ -88,8 +87,13 @@ class AppointmentController extends Controller |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
$appointment->save(); |
|
|
|
|
if($request->get('service_type') == "1"){ |
|
|
|
|
$service = 'education'; |
|
|
|
|
}else{ |
|
|
|
|
$service = 'visa'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return redirect($this->redirect)->with('success', 'Appointment has been added'); |
|
|
|
|
return redirect($this->redirect.'/'.$service)->with('success', 'Appointment has been added'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function edit($id) |
|
|
|
@ -107,12 +111,11 @@ class AppointmentController extends Controller |
|
|
|
|
|
|
|
|
|
public function update(Request $request, $id) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
$request->validate([ |
|
|
|
|
'date' => 'required|date', |
|
|
|
|
'start_time' => 'required|date_format:H:i', |
|
|
|
|
'end_time' => 'required|date_format:H:i', |
|
|
|
|
// 'location' => 'required|max:255', |
|
|
|
|
// 'description' => 'required', |
|
|
|
|
]); |
|
|
|
|
$start_time = Carbon::createFromFormat('H:i', $request->get('start_time'))->format('H:i A'); |
|
|
|
|
$end_time = Carbon::createFromFormat('H:i', $request->get('end_time'))->format('H:i A'); |
|
|
|
@ -126,8 +129,13 @@ class AppointmentController extends Controller |
|
|
|
|
$appointment->service_type = $request->get('service_type'); |
|
|
|
|
$appointment->status = $request->get('status'); |
|
|
|
|
$appointment->save(); |
|
|
|
|
if($request->get('service_type') == "1"){ |
|
|
|
|
$service = 'education'; |
|
|
|
|
}else{ |
|
|
|
|
$service = 'visa'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return redirect($this->redirect)->with('success', 'Appointment has been updated'); |
|
|
|
|
return redirect($this->redirect.'/'.$service)->with('success', 'Appointment has been updated'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function show($id) |
|
|
|
|