Gitamin\Http\Controllers\Projects\IssueController::store PHP Method

store() public method

public store ( $owner, $project )
    public function store($owner, $project)
    {
        $issueData = Input::get('issue');
        try {
            $issue = dispatch(new AddIssueCommand(Auth::user()->id, $project->id, $issueData['title'], $issueData['description']));
        } catch (ValidationException $e) {
            return Redirect::route('issue_new', ['owner' => $owner->slug, 'project' => $project->slug])->withInput(Input::all())->withErrors($e->getMessageBag());
        }
        return Redirect::route('issue_show', ['owner' => $owner->slug, 'project' => $project->slug, $issue->iid])->withSuccess(sprintf('%s %s', trans('hifone.awesome'), trans('hifone.success')));
    }