isTypeTeacher())->get(); return view('pad.avaliacao.index', [ 'index_menu' => MenuItemsAvaliador::PADs, 'professores' => null ]); } public function avaliar(Request $req) { $validated = $req->validate( [ 'tarefa_id' => ['required', 'integer'], 'status' => ['required', 'integer'], 'professor_id' => ['required', 'integer'], 'atividade_type' => ['required', 'integer'], 'descricao' => ['nullable', 'string'], 'hora_reajuste' => ['nullable', 'double'], ], [ 'required' => 'O campo de :attribute é obrigatório', ] ); if ($validated) { $user = Auth::user(); $avaliacao = Avaliacao::where(function ($query) use ($req) { $query->where('tarefa_id', '=', $req->tarefa_id); $query->where('type', '=', $req->atividade_type); })->first(); if (!$avaliacao) { dd('Avaliação não encontrada'); } $avaliacao->status = $req->status; $avaliacao->avaliador_id = $user->id; $avaliacao->descricao = $req->descricao ? $req->descricao : NULL; $avaliacao->hora_reajuste = $req->hora_reajuste; if ($avaliacao->save()) { dd($avaliacao); //return view('pad.avaliacao.dimensao.ensino', [ // 'index_menu' => MenuItemsAvaliador::PADs, // 'user_pad_id' => 1 //]); } } } /** * @param integer $id * @return \Illuminate\Http\Response */ public function view($id) { } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { } /** * Store a newly created resource in storage. * @param \Illuminate\Http\Request $request */ public function store(Request $request) { } public function anexo() { return view('pad.anexo', ['index_menu' => 1]); } /** * Show the form for editing the specified resource. * * @param integer $id * @return \Illuminate\Http\Response */ public function edit($id) { } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param integer $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { } public function delete($id) { } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { } }