|
|
|
@ -50,7 +50,7 @@ class AppointmentController extends Controller |
|
|
|
|
$appointments = $appointments->where('status', $status); |
|
|
|
|
} |
|
|
|
|
if (\request('is_booked')) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$is_booked = (\request('is_booked')) == '1' ? true : false; |
|
|
|
|
$appointments = $appointments->where('is_booked', $is_booked); |
|
|
|
|
} |
|
|
|
@ -73,10 +73,11 @@ 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, |
|
|
|
@ -87,13 +88,8 @@ class AppointmentController extends Controller |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
$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) |
|
|
|
@ -111,11 +107,12 @@ 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'); |
|
|
|
@ -129,13 +126,8 @@ 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.'/'.$service)->with('success', 'Appointment has been updated'); |
|
|
|
|
return redirect($this->redirect)->with('success', 'Appointment has been updated'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function show($id) |
|
|
|
|