public function destroy($code) { $testroom = TestRoom::where('code', '=', $code)->update(['trash' => true]); $testroom_students = TestRoomStudents::where('code', '=', $code)->update(['trash' => true]); Session::flash('flash_message', 'Стаята беше изтрита!'); return redirect()->route('admin.testroom.index'); }
public function deleteTestRoom($code) { $testroom = TestRoom::where('code', '=', $code)->where('trash', '=', true)->delete(); $testroom_students = TestRoomStudents::where('code', '=', $code)->where('trash', '=', true)->delete(); return back(); }