{"action":"created","comment":{"url":"https://api.github.com/repos/DoSomething/gladiator/pulls/comments/59430358","id":59430358,"diff_hunk":"@@ -25,9 +26,16 @@\n \n // Contest Factory.\n $factory->define(Contest::class, function (Generator $faker) {\n+\n+    $phoenix = new Phoenix;\n+\n+    $campaignIds = ['1247', '1663', '1581', '1593', '1467', '1334', '362', '46', '1650', '1560', '1222', '1667', '74', '1198', '886', '1492', '850', '1503', '1376', '1665', '955', '31'];","path":"database/factories/ModelFactory.php","position":15,"original_position":15,"commit_id":"a09b5ffe577d3ebc404185f4c6001b3b7be28f52","original_commit_id":"a09b5ffe577d3ebc404185f4c6001b3b7be28f52","user":{"login":"sbsmith86","id":1700409,"avatar_url":"https://avatars.githubusercontent.com/u/1700409?v=3","gravatar_id":"","url":"https://api.github.com/users/sbsmith86","html_url":"https://github.com/sbsmith86","followers_url":"https://api.github.com/users/sbsmith86/followers","following_url":"https://api.github.com/users/sbsmith86/following{/other_user}","gists_url":"https://api.github.com/users/sbsmith86/gists{/gist_id}","starred_url":"https://api.github.com/users/sbsmith86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbsmith86/subscriptions","organizations_url":"https://api.github.com/users/sbsmith86/orgs","repos_url":"https://api.github.com/users/sbsmith86/repos","events_url":"https://api.github.com/users/sbsmith86/events{/privacy}","received_events_url":"https://api.github.com/users/sbsmith86/received_events","type":"User","site_admin":false},"body":"YASSS :clap: ","created_at":"2016-04-12T18:39:48Z","updated_at":"2016-04-12T18:39:48Z","html_url":"https://github.com/DoSomething/gladiator/pull/202#discussion_r59430358","pull_request_url":"https://api.github.com/repos/DoSomething/gladiator/pulls/202","_links":{"self":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/comments/59430358"},"html":{"href":"https://github.com/DoSomething/gladiator/pull/202#discussion_r59430358"},"pull_request":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/202"}}},"pull_request":{"url":"https://api.github.com/repos/DoSomething/gladiator/pulls/202","id":66066346,"html_url":"https://github.com/DoSomething/gladiator/pull/202","diff_url":"https://github.com/DoSomething/gladiator/pull/202.diff","patch_url":"https://github.com/DoSomething/gladiator/pull/202.patch","issue_url":"https://api.github.com/repos/DoSomething/gladiator/issues/202","number":202,"state":"open","locked":false,"title":"Campaign data caching & general cache improvements","user":{"login":"weerd","id":105849,"avatar_url":"https://avatars.githubusercontent.com/u/105849?v=3","gravatar_id":"","url":"https://api.github.com/users/weerd","html_url":"https://github.com/weerd","followers_url":"https://api.github.com/users/weerd/followers","following_url":"https://api.github.com/users/weerd/following{/other_user}","gists_url":"https://api.github.com/users/weerd/gists{/gist_id}","starred_url":"https://api.github.com/users/weerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weerd/subscriptions","organizations_url":"https://api.github.com/users/weerd/orgs","repos_url":"https://api.github.com/users/weerd/repos","events_url":"https://api.github.com/users/weerd/events{/privacy}","received_events_url":"https://api.github.com/users/weerd/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\nThis PR expands on the work done in #182 to now also cache the campaign data in Redis and prefix it with `campaign:` just in case to avoid any collisions with future caching of data. The update also refactors the caching system a bit to use a `CacheStorage` trait for all the general caching methods that not _both_ the `CacheCampaignRepository` AND `CacheUserRepository` both use. DRY that shiz up! Both classes `use` the new trait to expand their functionality. \r\n\r\nIt also breaks out a new general `RepositoryContract` for all Repository related classes, that other contracts can extend and all Repository related classed must implement.\r\n\r\nLastly, this PR also updates the `Contest` seeding to use real, actual campaign from DS staging. 🎉  The random numbers we were using to temporarily fill in those database fields were starting to cause too many issues with building out features, and had to constantly manually edit the ids to real campaign ids in the database. No more of that sillyness.\r\n\r\n#### How should this be manually tested?\r\nThe usual, pul down, `dump-autoload`, do a full `migrate:refresh` and `db:seed` and then peruse the contests? Is stuff broken? Are you seeing actual campaign titles. You can also jump into Redis on Homestead and check if stuff is being cached using:\r\n\r\n```\r\nredis-cli\r\n```\r\n```\r\nkeys *\r\n```\r\n\r\nIf you are seeing keys that look like `laravel:campaign:955` (the id number will vary) then it's working!\r\n\r\n#### Any background context you want to provide?\r\nwhat else?\r\n\r\n#### What are the relevant tickets?\r\nFixes #178\r\n\r\n---\r\n@DoSomething/gladiator ","created_at":"2016-04-11T21:33:51Z","updated_at":"2016-04-12T18:39:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78567382ecf74e98cbbd96a7bbe2f0e55528520c","assignee":{"login":"sbsmith86","id":1700409,"avatar_url":"https://avatars.githubusercontent.com/u/1700409?v=3","gravatar_id":"","url":"https://api.github.com/users/sbsmith86","html_url":"https://github.com/sbsmith86","followers_url":"https://api.github.com/users/sbsmith86/followers","following_url":"https://api.github.com/users/sbsmith86/following{/other_user}","gists_url":"https://api.github.com/users/sbsmith86/gists{/gist_id}","starred_url":"https://api.github.com/users/sbsmith86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbsmith86/subscriptions","organizations_url":"https://api.github.com/users/sbsmith86/orgs","repos_url":"https://api.github.com/users/sbsmith86/repos","events_url":"https://api.github.com/users/sbsmith86/events{/privacy}","received_events_url":"https://api.github.com/users/sbsmith86/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/gladiator/pulls/202/commits","review_comments_url":"https://api.github.com/repos/DoSomething/gladiator/pulls/202/comments","review_comment_url":"https://api.github.com/repos/DoSomething/gladiator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/gladiator/issues/202/comments","statuses_url":"https://api.github.com/repos/DoSomething/gladiator/statuses/a09b5ffe577d3ebc404185f4c6001b3b7be28f52","head":{"label":"DoSomething:campaign-cache-repository","ref":"campaign-cache-repository","sha":"a09b5ffe577d3ebc404185f4c6001b3b7be28f52","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":51176505,"name":"gladiator","full_name":"DoSomething/gladiator","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/gladiator","description":"The DoSomething.org Competitions Platform","fork":false,"url":"https://api.github.com/repos/DoSomething/gladiator","forks_url":"https://api.github.com/repos/DoSomething/gladiator/forks","keys_url":"https://api.github.com/repos/DoSomething/gladiator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/gladiator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/gladiator/teams","hooks_url":"https://api.github.com/repos/DoSomething/gladiator/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/gladiator/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/gladiator/events","assignees_url":"https://api.github.com/repos/DoSomething/gladiator/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/gladiator/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/gladiator/tags","blobs_url":"https://api.github.com/repos/DoSomething/gladiator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/gladiator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/gladiator/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/gladiator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/gladiator/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/gladiator/languages","stargazers_url":"https://api.github.com/repos/DoSomething/gladiator/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/gladiator/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/gladiator/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/gladiator/subscription","commits_url":"https://api.github.com/repos/DoSomething/gladiator/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/gladiator/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/gladiator/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/gladiator/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/gladiator/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/gladiator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/gladiator/merges","archive_url":"https://api.github.com/repos/DoSomething/gladiator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/gladiator/downloads","issues_url":"https://api.github.com/repos/DoSomething/gladiator/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/gladiator/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/gladiator/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/gladiator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/gladiator/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/gladiator/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/gladiator/deployments","created_at":"2016-02-05T21:53:32Z","updated_at":"2016-02-05T22:11:13Z","pushed_at":"2016-04-12T18:32:47Z","git_url":"git://github.com/DoSomething/gladiator.git","ssh_url":"git@github.com:DoSomething/gladiator.git","clone_url":"https://github.com/DoSomething/gladiator.git","svn_url":"https://github.com/DoSomething/gladiator","homepage":null,"size":543,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":26,"forks":1,"open_issues":26,"watchers":0,"default_branch":"master"}},"base":{"label":"DoSomething:master","ref":"master","sha":"00b1b5a34af89a78ff3d3bc9c6f05b31bfc7e0f8","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":51176505,"name":"gladiator","full_name":"DoSomething/gladiator","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/gladiator","description":"The DoSomething.org Competitions Platform","fork":false,"url":"https://api.github.com/repos/DoSomething/gladiator","forks_url":"https://api.github.com/repos/DoSomething/gladiator/forks","keys_url":"https://api.github.com/repos/DoSomething/gladiator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/gladiator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/gladiator/teams","hooks_url":"https://api.github.com/repos/DoSomething/gladiator/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/gladiator/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/gladiator/events","assignees_url":"https://api.github.com/repos/DoSomething/gladiator/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/gladiator/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/gladiator/tags","blobs_url":"https://api.github.com/repos/DoSomething/gladiator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/gladiator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/gladiator/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/gladiator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/gladiator/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/gladiator/languages","stargazers_url":"https://api.github.com/repos/DoSomething/gladiator/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/gladiator/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/gladiator/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/gladiator/subscription","commits_url":"https://api.github.com/repos/DoSomething/gladiator/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/gladiator/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/gladiator/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/gladiator/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/gladiator/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/gladiator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/gladiator/merges","archive_url":"https://api.github.com/repos/DoSomething/gladiator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/gladiator/downloads","issues_url":"https://api.github.com/repos/DoSomething/gladiator/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/gladiator/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/gladiator/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/gladiator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/gladiator/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/gladiator/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/gladiator/deployments","created_at":"2016-02-05T21:53:32Z","updated_at":"2016-02-05T22:11:13Z","pushed_at":"2016-04-12T18:32:47Z","git_url":"git://github.com/DoSomething/gladiator.git","ssh_url":"git@github.com:DoSomething/gladiator.git","clone_url":"https://github.com/DoSomething/gladiator.git","svn_url":"https://github.com/DoSomething/gladiator","homepage":null,"size":543,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":26,"forks":1,"open_issues":26,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/202"},"html":{"href":"https://github.com/DoSomething/gladiator/pull/202"},"issue":{"href":"https://api.github.com/repos/DoSomething/gladiator/issues/202"},"comments":{"href":"https://api.github.com/repos/DoSomething/gladiator/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/gladiator/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/gladiator/statuses/a09b5ffe577d3ebc404185f4c6001b3b7be28f52"}}}}