Ejemplo n.º 1
0
 /**
  * 
  * Remove the project alongside deploy dir.
  * @param type $id
  * @return type
  */
 public function get_delete($id)
 {
     $project = Projects::find($id);
     $m = new Messages();
     if (!$project) {
         $m->add('error', "Unknown project!");
         return Redirect::to(handles('orchestra::resources/githubdeploys'))->with('message', $m->serialize());
     }
     $proj = new Githubdeploys\Release();
     $proj->deleteProject($project);
     if ($project->delete()) {
         Deploys::where('project_id', '=', $id)->delete();
         $m->add('success', "Project deleted alongside deploy path!");
     } else {
         $m->add('error', "Could not remove project from the database!");
     }
     return Redirect::to(handles('orchestra::resources/githubdeploys'))->with('message', $m->serialize());
 }