Skip to content

Instantly share code, notes, and snippets.

@jhonnrodr
Created November 16, 2014 22:15
Show Gist options
  • Save jhonnrodr/16702904b6833716c00d to your computer and use it in GitHub Desktop.
Save jhonnrodr/16702904b6833716c00d to your computer and use it in GitHub Desktop.
try{
$file = Archive::find($id);
if ($file) {
$file->delete();
return Response::json(array(
'success' => true
));
}else{
return Response::json(array(
'success' => false
));
}
}catch(ModelNotFoundException $e){
return Response::json(array(
'success' => false
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment