|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
+use App\Models\Appointment;
|
|
use App\Models\CareMonth;
|
|
use App\Models\CareMonth;
|
|
use App\Models\CareMonthEntry;
|
|
use App\Models\CareMonthEntry;
|
|
use App\Models\Client;
|
|
use App\Models\Client;
|
|
@@ -50,4 +51,16 @@ class GuestController extends Controller
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function appointmentConfirmation(Request $request, $appointmentUid )
|
|
|
|
+ {
|
|
|
|
+ $appointment = Appointment::where('uid', $appointmentUid)->first();
|
|
|
|
+ abort_if(!count($appointment->confirmationRequests), 404, 'No confirmation requests on this appointment.');
|
|
|
|
+ abort_if(!$appointment, 404, 'Invalid url');
|
|
|
|
+ abort_if($appointment->status == 'CANCELLED', 404, 'Appointment has been cancelled');
|
|
|
|
+ abort_if($appointment->status == 'COMPLETED', 404, 'Appointment has been completed');
|
|
|
|
+ abort_if($appointment->status == 'ABANDONED', 404, 'Appointment has been abandoned');
|
|
|
|
+
|
|
|
|
+ return view('app.guest.appointment-confirmation', compact('appointment'));
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|