{"action":"opened","number":862,"pull_request":{"url":"https://api.github.com/repos/nova-framework/framework/pulls/862","id":70930418,"html_url":"https://github.com/nova-framework/framework/pull/862","diff_url":"https://github.com/nova-framework/framework/pull/862.diff","patch_url":"https://github.com/nova-framework/framework/pull/862.patch","issue_url":"https://api.github.com/repos/nova-framework/framework/issues/862","number":862,"state":"open","locked":false,"title":"Implementation of a Laravel-esque Request, Input (and Response) support","user":{"login":"LuckyCyborg","id":13488485,"avatar_url":"https://avatars.githubusercontent.com/u/13488485?v=3","gravatar_id":"","url":"https://api.github.com/users/LuckyCyborg","html_url":"https://github.com/LuckyCyborg","followers_url":"https://api.github.com/users/LuckyCyborg/followers","following_url":"https://api.github.com/users/LuckyCyborg/following{/other_user}","gists_url":"https://api.github.com/users/LuckyCyborg/gists{/gist_id}","starred_url":"https://api.github.com/users/LuckyCyborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuckyCyborg/subscriptions","organizations_url":"https://api.github.com/users/LuckyCyborg/orgs","repos_url":"https://api.github.com/users/LuckyCyborg/repos","events_url":"https://api.github.com/users/LuckyCyborg/events{/privacy}","received_events_url":"https://api.github.com/users/LuckyCyborg/received_events","type":"User","site_admin":false},"body":"This pull request introduce a implementation of a simple but very powerful **Request API**, built in top of **Symfony HTTP Foundation**, and being similar with its counterpart **Laravel 4.x**, of what documentation apply, excluding the **Session** part, which is not (yet) completed.\r\n\r\nThe objective is to create a fully functional support for HTTP Requests, even for complicated RESTful APIs, in the same time to simplify the input data handling on a daily base.\r\n\r\nThe usage could be very simple, as in following example, together with the **Validator**:\r\n\r\n```php\r\nuse Validator;\r\nuse Input;\r\n\r\n$rules = array(\r\n    'username' => 'required|min:3|max:50|alpha_dash|unique:users',\r\n    'password' => 'required|between:4,30',\r\n    'email'    => 'required|email|max:100|unique:users',\r\n);\r\n\r\n// Collect all input data (i.e. $_POST and $_FILES, for POST)\r\n$data = Input::all();\r\n\r\n$validator = Validator::make($data, $rules);\r\n\r\nif ($validator->passes()) {\r\n    // Do something shiny, the input data is perfect.\r\n} else {\r\n    $errors = $validator->errors()->all();\r\n\r\n    // Do something nasty, because the data is wrong.\r\n}\r\n```\r\nA more simple example is:\r\n```\r\nif (Input::has('username')) {\r\n    $username = Input::get('username');\r\n\r\n    // Do something shiny with this variable\r\n}\r\n```\r\n\r\nBut this new Request API is not only about that, for example, you can simply detect a AJAX Request, just like in the actual API:\r\n\r\n```php\r\nif(Request::ajax()) {\r\n    // You are set, this is a AJAX Request\r\n}\r\n```\r\nOR see if you have a POST Request:\r\n```php\r\nif(Request::method() == 'POST') {\r\n    // You are set, this is a POST Request\r\n}\r\n```\r\n\r\nFinally, there apply almost the entire Illuminate\\Request v.4.x API, for example, you can do:\r\n```\r\nif (Request::isJson()) {\r\n    // Get the variable 'result' from the JSON encoded Content\r\n    $result = Request::json('$result');\r\n}\r\n```\r\nOR\r\n```php\r\n// Get the current path info for the request.\r\n$path = Request::path();\r\n```\r\n\r\nTo note that, while present, it is not possible yet to use the **Session (and Flash)** methods from **Http\\Request**.\r\n\r\nAlso, it is not possible yet to use the **Response API**, which while completed, is not yet intergrated full, then it is safely to ignore it for moment.\r\n","created_at":"2016-05-20T23:31:14Z","updated_at":"2016-05-20T23:31:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nova-framework/framework/pulls/862/commits","review_comments_url":"https://api.github.com/repos/nova-framework/framework/pulls/862/comments","review_comment_url":"https://api.github.com/repos/nova-framework/framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nova-framework/framework/issues/862/comments","statuses_url":"https://api.github.com/repos/nova-framework/framework/statuses/d0635fd5133b62a7721ae0dc9237c09563a55125","head":{"label":"LuckyCyborg:master","ref":"master","sha":"d0635fd5133b62a7721ae0dc9237c09563a55125","user":{"login":"LuckyCyborg","id":13488485,"avatar_url":"https://avatars.githubusercontent.com/u/13488485?v=3","gravatar_id":"","url":"https://api.github.com/users/LuckyCyborg","html_url":"https://github.com/LuckyCyborg","followers_url":"https://api.github.com/users/LuckyCyborg/followers","following_url":"https://api.github.com/users/LuckyCyborg/following{/other_user}","gists_url":"https://api.github.com/users/LuckyCyborg/gists{/gist_id}","starred_url":"https://api.github.com/users/LuckyCyborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuckyCyborg/subscriptions","organizations_url":"https://api.github.com/users/LuckyCyborg/orgs","repos_url":"https://api.github.com/users/LuckyCyborg/repos","events_url":"https://api.github.com/users/LuckyCyborg/events{/privacy}","received_events_url":"https://api.github.com/users/LuckyCyborg/received_events","type":"User","site_admin":false},"repo":{"id":47835170,"name":"simple-mvc-framework","full_name":"LuckyCyborg/simple-mvc-framework","owner":{"login":"LuckyCyborg","id":13488485,"avatar_url":"https://avatars.githubusercontent.com/u/13488485?v=3","gravatar_id":"","url":"https://api.github.com/users/LuckyCyborg","html_url":"https://github.com/LuckyCyborg","followers_url":"https://api.github.com/users/LuckyCyborg/followers","following_url":"https://api.github.com/users/LuckyCyborg/following{/other_user}","gists_url":"https://api.github.com/users/LuckyCyborg/gists{/gist_id}","starred_url":"https://api.github.com/users/LuckyCyborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuckyCyborg/subscriptions","organizations_url":"https://api.github.com/users/LuckyCyborg/orgs","repos_url":"https://api.github.com/users/LuckyCyborg/repos","events_url":"https://api.github.com/users/LuckyCyborg/events{/privacy}","received_events_url":"https://api.github.com/users/LuckyCyborg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LuckyCyborg/simple-mvc-framework","description":"Simple but powerful MVC PHP Framework","fork":true,"url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework","forks_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/forks","keys_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/teams","hooks_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/hooks","issue_events_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/issues/events{/number}","events_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/events","assignees_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/assignees{/user}","branches_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/branches{/branch}","tags_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/tags","blobs_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/languages","stargazers_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/stargazers","contributors_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/contributors","subscribers_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/subscribers","subscription_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/subscription","commits_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/contents/{+path}","compare_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/merges","archive_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/downloads","issues_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/issues{/number}","pulls_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/labels{/name}","releases_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/releases{/id}","deployments_url":"https://api.github.com/repos/LuckyCyborg/simple-mvc-framework/deployments","created_at":"2015-12-11T15:44:20Z","updated_at":"2016-03-29T09:02:20Z","pushed_at":"2016-05-20T22:55:18Z","git_url":"git://github.com/LuckyCyborg/simple-mvc-framework.git","ssh_url":"git@github.com:LuckyCyborg/simple-mvc-framework.git","clone_url":"https://github.com/LuckyCyborg/simple-mvc-framework.git","svn_url":"https://github.com/LuckyCyborg/simple-mvc-framework","homepage":"http://novaframework.com/","size":9102,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nova-framework:master","ref":"master","sha":"55294c0c2320096c2b43cad2e4cb6321fb89faf3","user":{"login":"nova-framework","id":7198958,"avatar_url":"https://avatars.githubusercontent.com/u/7198958?v=3","gravatar_id":"","url":"https://api.github.com/users/nova-framework","html_url":"https://github.com/nova-framework","followers_url":"https://api.github.com/users/nova-framework/followers","following_url":"https://api.github.com/users/nova-framework/following{/other_user}","gists_url":"https://api.github.com/users/nova-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/nova-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nova-framework/subscriptions","organizations_url":"https://api.github.com/users/nova-framework/orgs","repos_url":"https://api.github.com/users/nova-framework/repos","events_url":"https://api.github.com/users/nova-framework/events{/privacy}","received_events_url":"https://api.github.com/users/nova-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":18726585,"name":"framework","full_name":"nova-framework/framework","owner":{"login":"nova-framework","id":7198958,"avatar_url":"https://avatars.githubusercontent.com/u/7198958?v=3","gravatar_id":"","url":"https://api.github.com/users/nova-framework","html_url":"https://github.com/nova-framework","followers_url":"https://api.github.com/users/nova-framework/followers","following_url":"https://api.github.com/users/nova-framework/following{/other_user}","gists_url":"https://api.github.com/users/nova-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/nova-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nova-framework/subscriptions","organizations_url":"https://api.github.com/users/nova-framework/orgs","repos_url":"https://api.github.com/users/nova-framework/repos","events_url":"https://api.github.com/users/nova-framework/events{/privacy}","received_events_url":"https://api.github.com/users/nova-framework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nova-framework/framework","description":"Simple but powerful MVC PHP Framework","fork":false,"url":"https://api.github.com/repos/nova-framework/framework","forks_url":"https://api.github.com/repos/nova-framework/framework/forks","keys_url":"https://api.github.com/repos/nova-framework/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nova-framework/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nova-framework/framework/teams","hooks_url":"https://api.github.com/repos/nova-framework/framework/hooks","issue_events_url":"https://api.github.com/repos/nova-framework/framework/issues/events{/number}","events_url":"https://api.github.com/repos/nova-framework/framework/events","assignees_url":"https://api.github.com/repos/nova-framework/framework/assignees{/user}","branches_url":"https://api.github.com/repos/nova-framework/framework/branches{/branch}","tags_url":"https://api.github.com/repos/nova-framework/framework/tags","blobs_url":"https://api.github.com/repos/nova-framework/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nova-framework/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nova-framework/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/nova-framework/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nova-framework/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/nova-framework/framework/languages","stargazers_url":"https://api.github.com/repos/nova-framework/framework/stargazers","contributors_url":"https://api.github.com/repos/nova-framework/framework/contributors","subscribers_url":"https://api.github.com/repos/nova-framework/framework/subscribers","subscription_url":"https://api.github.com/repos/nova-framework/framework/subscription","commits_url":"https://api.github.com/repos/nova-framework/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/nova-framework/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/nova-framework/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/nova-framework/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/nova-framework/framework/contents/{+path}","compare_url":"https://api.github.com/repos/nova-framework/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nova-framework/framework/merges","archive_url":"https://api.github.com/repos/nova-framework/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nova-framework/framework/downloads","issues_url":"https://api.github.com/repos/nova-framework/framework/issues{/number}","pulls_url":"https://api.github.com/repos/nova-framework/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/nova-framework/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/nova-framework/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nova-framework/framework/labels{/name}","releases_url":"https://api.github.com/repos/nova-framework/framework/releases{/id}","deployments_url":"https://api.github.com/repos/nova-framework/framework/deployments","created_at":"2014-04-13T10:22:38Z","updated_at":"2016-05-18T08:48:27Z","pushed_at":"2016-05-20T23:31:14Z","git_url":"git://github.com/nova-framework/framework.git","ssh_url":"git@github.com:nova-framework/framework.git","clone_url":"https://github.com/nova-framework/framework.git","svn_url":"https://github.com/nova-framework/framework","homepage":"http://novaframework.com/","size":10387,"stargazers_count":347,"watchers_count":347,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":214,"mirror_url":null,"open_issues_count":2,"forks":214,"open_issues":2,"watchers":347,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nova-framework/framework/pulls/862"},"html":{"href":"https://github.com/nova-framework/framework/pull/862"},"issue":{"href":"https://api.github.com/repos/nova-framework/framework/issues/862"},"comments":{"href":"https://api.github.com/repos/nova-framework/framework/issues/862/comments"},"review_comments":{"href":"https://api.github.com/repos/nova-framework/framework/pulls/862/comments"},"review_comment":{"href":"https://api.github.com/repos/nova-framework/framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nova-framework/framework/pulls/862/commits"},"statuses":{"href":"https://api.github.com/repos/nova-framework/framework/statuses/d0635fd5133b62a7721ae0dc9237c09563a55125"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1792,"deletions":3,"changed_files":20}}
{"actor":{"display_login":"LuckyCyborg"}}