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