@@ 160-177 (lines=18) @@ | ||
157 | * |
|
158 | * @return \Illuminate\Http\RedirectResponse |
|
159 | */ |
|
160 | public function updateAction($path) |
|
161 | { |
|
162 | $groupData = Binput::get('group'); |
|
163 | $group = Owner::where('path', '=', $path)->first(); |
|
164 | try { |
|
165 | $groupData['owner'] = $group; |
|
166 | $groupData['user_id'] = Auth::user()->id; |
|
167 | $group = $this->dispatchFromArray(UpdateOwnerCommand::class, $groupData); |
|
168 | } catch (ValidationException $e) { |
|
169 | return Redirect::route('groups.group_edit', ['owner' => $group->path]) |
|
170 | ->withInput(Binput::all()) |
|
171 | ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('gitamin.groups.edit.failure'))) |
|
172 | ->withErrors($e->getMessageBag()); |
|
173 | } |
|
174 | ||
175 | return Redirect::route('groups.group_edit', ['owner' => $group->path]) |
|
176 | ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('gitamin.groups.edit.success'))); |
|
177 | } |
|
178 | } |
|
179 |
@@ 70-88 (lines=19) @@ | ||
67 | * |
|
68 | * @return \Illuminate\Http\Response |
|
69 | */ |
|
70 | public function createAction($namespace, $project_path) |
|
71 | { |
|
72 | $project = Project::findByPath($namespace, $project_path); |
|
73 | $issueData = Binput::get('issue'); |
|
74 | ||
75 | try { |
|
76 | $issueData['author_id'] = Auth::user()->id; |
|
77 | $issueData['project_id'] = $project->id; |
|
78 | $issue = $this->dispatchFromArray(AddIssueCommand::class, $issueData); |
|
79 | } catch (ValidationException $e) { |
|
80 | return Redirect::route('projects.issue_new') |
|
81 | ->withInput(Binput::all()) |
|
82 | ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.issues.new.failure'))) |
|
83 | ->withErrors($e->getMessageBag()); |
|
84 | } |
|
85 | ||
86 | return Redirect::route('projects.issue_index', ['owner' => $namespace, 'project' => $project_path]) |
|
87 | ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.issues.new.success'))); |
|
88 | } |
|
89 | ||
90 | public function editAction($owner_path, $project_path, Issue $issue) |
|
91 | { |