Created
April 23, 2014 23:42
-
-
Save csalajan/11236378 to your computer and use it in GitHub Desktop.
Delete Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function postDelete(){ | |
$id = Input::get('id'); | |
try{ | |
$equipment = Equipment::findOrFail($id); | |
$equipment -> delete(); | |
} | |
catch(Exception $e){ | |
//return Response::json(array('status' => 400, 'message' => 'equipment not found', 'error' => $e), 400); | |
return Redirect::to('inventory/equipment')->with(array('status' => 201, 'message' => 'Failed to Delete Equipment', 'error' => $e)); | |
} | |
//return Response::json(array('status' => 201, 'message' => 'equipment deleted'), 201); | |
return Redirect::to('inventory/equipment')->with(array('status' => 201, 'message' => 'Equipment Deleted Successfully')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment