/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { return View('admin.competitionWorks.edit', ['competitionParticipantList' => CompetitionParticipant::orderBy('name')->lists('name', 'id'), 'competitionWork' => CompetitionWork::find($id), 'competitionNominationList' => CompetitionNomination::whereHas('competition', function ($query) { $query->where('status', 0); })->lists('title', 'id')]); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { CompetitionParticipant::destroy($id); return redirect('/admin/competitionParticipants'); }