/** * Store a newly created resource in storage. * * @return Response */ public function store(ExamRequest $request) { return Exam::create($request->all())->toJson(); }
public function post_exam(Request $request) { if (Auth::user()->type == 'teacher') { if (Auth::user()->teacherinfo->packageinfo->exams - count(Auth::user()->exams) != 0) { Exam::create(['type' => $request->input('examtype'), 'tutorid' => Auth::user()->id, 'date' => $request->input('date'), 'time' => $request->input('time'), 'duration' => $request->input('duration'), 'mark' => $request->input('mark')]); } } }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(ExamRequest $request) { Exam::create($request->all()); return "Saved!"; }