Esempio n. 1
0
 /**
  * Determine if the user is authorized to make this request.
  *
  * @return bool
  */
 public function authorize()
 {
     return Exam::where(['id' => $this->id, 'user_id' => $this->user()->id])->exists();
 }
Esempio n. 2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $exam = Exam::findOrFail($id);
     return view('exams.show', compact('exam'));
 }
Esempio n. 3
0
 public function store($id, PaperRequest $request)
 {
     $exam = Exam::findOrFail($id);
     $paper = $request->file('paper');
     (new AddPaperToExam($exam, $paper))->save();
 }