/** * @param $username * @return array */ public function getAuthorPublishableGists($username) { $gists = $this->getAuthorGists($username); return array_filter(array_map(function ($gist) { if ($this->gistIsGistlogPublished($gist)) { $fullGist = $this->gistClient->getGist($gist['id']); if (!$this->gistIsDraft($fullGist)) { return $fullGist; } } }, $gists)); }
public function postComment(Request $request, GistClient $client, $gistId) { $this->validate($request, ['comment' => 'required']); $client->postGistComment($gistId, Input::get('comment')); return redirect()->back(); }