Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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');
 }