/** * Show the form for editing the specified resource. * * @param $session_id * @param $session_type * @return Response * @internal param int $id */ public function edit($user_id, $session_id, $session_type) { $practiceSession = PracticeSession::find($session_id); if (!$practiceSession) { return $this->respondNotFound('Unable to find session'); } $practiceSession->session_type = $session_type; $practiceSession->save(); }
public function validateSessionMaterial($user_id, $session_id, $material_id) { $session = PracticeSession::find($session_id); if ($session) { if ($session->user_id == $user_id) { $material = PracticeMaterial::find($material_id); if ($material) { if ($material->session_id == $session->id) { return TRUE; } } } } return FALSE; // $session_id == $material->session_id }