public function delete(Request $request) { try { $this->validate($request, ['id' => 'required']); $agreement = Agreement::find($request->id); $agreement->forceDelete(); return response(1, 200); } catch (\Exception $e) { return response(0, 400); } }
public function destroy($id) { $agreement = Agreement::find($id); $agreementId = $agreement->client_id; $agreement->delete(); // redirect //Session::flash('message', 'Successfully deleted the nerd!'); return Redirect::to('client/' . $agreementId . '/agreement'); }