/** * * Display all releases deployed from the project. * @param type $id * @return type */ public function get_index($id = null) { $project = Projects::find($id); if (!$project) { $m = new Messages(); $m->add('error', "Unknown project!"); return Redirect::to(handles('orchestra::resources/githubdeploys'))->with('message', $m->serialize()); } $rel = new \Githubdeploys\Release(); $currentRelease = $rel->getCurrentRelease($project); $releases = Deploys::getDeploysByProject($id); View::share('_title_', 'Project Deploys'); $data = array('project' => $project, 'releases' => $releases, 'currentRelease' => $currentRelease); return View::make('githubdeploys::githubdeploys.releases-index', $data); }
/** * * Manage projects. * @param type $id * @return type */ public function get_manage($id = null) { if ($id) { $project = Projects::find($id); if (!$project) { $m = new Messages(); $m->add('error', "Unknown project!"); return Redirect::to(handles('orchestra::resources/githubdeploys'))->with('message', $m->serialize()); } View::share('_title_', "Edit project"); $data = array('project' => $project, 'type' => 'update'); } else { $project = new Projects(); View::share('_title_', 'Add project'); $data = array('project' => $project, 'type' => 'create'); } return View::make('githubdeploys::githubdeploys.index-manage', $data); }