{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/11513","labels_url":"https://api.github.com/repos/laravel/framework/issues/11513/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/11513/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/11513/events","html_url":"https://github.com/laravel/framework/issues/11513","id":123810576,"number":11513,"title":"Get Request Args","user":{"login":"gfazioli","id":432181,"avatar_url":"https://avatars.githubusercontent.com/u/432181?v=3","gravatar_id":"","url":"https://api.github.com/users/gfazioli","html_url":"https://github.com/gfazioli","followers_url":"https://api.github.com/users/gfazioli/followers","following_url":"https://api.github.com/users/gfazioli/following{/other_user}","gists_url":"https://api.github.com/users/gfazioli/gists{/gist_id}","starred_url":"https://api.github.com/users/gfazioli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfazioli/subscriptions","organizations_url":"https://api.github.com/users/gfazioli/orgs","repos_url":"https://api.github.com/users/gfazioli/repos","events_url":"https://api.github.com/users/gfazioli/events{/privacy}","received_events_url":"https://api.github.com/users/gfazioli/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-24T14:55:26Z","updated_at":"2016-01-06T20:22:18Z","closed_at":"2015-12-24T15:00:52Z","body":"I suggest to add this helper function for get the arguments in GET request:\r\n\r\n```php\r\nif ( ! function_exists( 'get_request_args' ) ) {\r\n\r\n/**\r\n* Get the request args.\r\n*\r\n* @param array $defaults Optional. Default values for args.\r\n*\r\n* @return array\r\n*/\r\nfunction get_request_args( $defaults = [ ] )\r\n{\r\n  $args = [ ];\r\n\r\n  // loop into request\r\n  foreach ( request()->all() as $key => $value ) {\r\n    if ( 'q' == $key && ! empty( $value ) ) {\r\n      list( $param, $paramValue ) = explode( '=', $value );\r\n      $args[ $param ] = $paramValue;\r\n    }\r\n    elseif ( 'q' != $key ) {\r\n      $args[ $key ] = $value;\r\n    }\r\n  }\r\n\r\n  // set defaults\r\n  if ( ! empty( $defaults ) ) {\r\n    foreach ( $defaults as $key => $value ) {\r\n      if ( ! isset( $args[ $key ] ) ) {\r\n        $args[ $key ] = $value;\r\n      }\r\n    }\r\n  }\r\n  return $args;\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/169450321","html_url":"https://github.com/laravel/framework/issues/11513#issuecomment-169450321","issue_url":"https://api.github.com/repos/laravel/framework/issues/11513","id":169450321,"user":{"login":"gfazioli","id":432181,"avatar_url":"https://avatars.githubusercontent.com/u/432181?v=3","gravatar_id":"","url":"https://api.github.com/users/gfazioli","html_url":"https://github.com/gfazioli","followers_url":"https://api.github.com/users/gfazioli/followers","following_url":"https://api.github.com/users/gfazioli/following{/other_user}","gists_url":"https://api.github.com/users/gfazioli/gists{/gist_id}","starred_url":"https://api.github.com/users/gfazioli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfazioli/subscriptions","organizations_url":"https://api.github.com/users/gfazioli/orgs","repos_url":"https://api.github.com/users/gfazioli/repos","events_url":"https://api.github.com/users/gfazioli/events{/privacy}","received_events_url":"https://api.github.com/users/gfazioli/received_events","type":"User","site_admin":false},"created_at":"2016-01-06T20:22:18Z","updated_at":"2016-01-06T20:22:18Z","body":"@GrahamCampbell UPDATE, you can ignore this function beacuse it is caused by an error on my ngnix, in other words my vagrant installation used:\r\n\r\n`try_files $uri $uri/ /index.php?q=$query_string;`\r\n\r\ninstead\r\n\r\n`try_files $uri $uri/ /index.php?$query_string;`\r\n\r\nfor example, I got\r\n\r\n![image](https://cloud.githubusercontent.com/assets/432181/12153679/86fff02c-b4bb-11e5-8f4f-34c17d4e701a.png)\r\n\r\n"}}