Esempio n. 1
0
 public function update(ClassroomSession $session, UpdateClassroomSessionRequest $request)
 {
     if ($session->start_at->isPast()) {
         return redirect()->route('classrooms.sessions.index')->with('error', trans('classrooms::sessions.cant_modify_started_sessions'));
     }
     $session->load('subject', 'interval', 'teacher');
     $session->fill($request->only('duration', 'start_at', 'title'));
     $session->save();
     try {
         $classroom = WiziqClassroom::build($session->interval->title . " - " . $session->subject->name, new \DateTime($session->start_at))->withDuration($session->duration)->withPresenter($session->teacher->id, $session->teacher->name)->withAttendeeLimit(config("classrooms.attendee_limit"))->withReturnUrl('')->withCreateRecording(true)->withPresenterDefaultControls('audio, video')->withTimeZone("Asia/Muscat")->withStatusPingUrl("https://google.com")->withLanguageCultureName("ar-SA");
         $WiziqApi = new WiziqApi();
         $response = $WiziqApi->modify($session->wiziq_id, $classroom);
     } catch (mikemix\Wiziq\Common\Api\Exception\CallException $e) {
         die($e->getMessage());
     } catch (mikemix\Wiziq\Common\Http\Exception\InvalidResponseException $e) {
         die($e->getMessage());
     }
     return redirect()->route('classrooms.sessions.index');
 }