Created
April 23, 2014 23:43
-
-
Save csalajan/11236412 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 Redirect::to('inventory/equipment')->with(array('status' => 201, 'message' => 'Failed to Delete Equipment', 'error' => $e)); | |
} | |
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