{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/23412","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/23412/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/23412/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/23412/events","html_url":"https://github.com/laravel/framework/pull/23412","id":302810347,"number":23412,"title":"[5.6] Don't bind parameters when DB::raw(...) is used with Builder::whereBetween","user":{"login":"mike-grinspan","id":8433459,"avatar_url":"https://avatars3.githubusercontent.com/u/8433459?v=4","gravatar_id":"","url":"https://api.github.com/users/mike-grinspan","html_url":"https://github.com/mike-grinspan","followers_url":"https://api.github.com/users/mike-grinspan/followers","following_url":"https://api.github.com/users/mike-grinspan/following{/other_user}","gists_url":"https://api.github.com/users/mike-grinspan/gists{/gist_id}","starred_url":"https://api.github.com/users/mike-grinspan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike-grinspan/subscriptions","organizations_url":"https://api.github.com/users/mike-grinspan/orgs","repos_url":"https://api.github.com/users/mike-grinspan/repos","events_url":"https://api.github.com/users/mike-grinspan/events{/privacy}","received_events_url":"https://api.github.com/users/mike-grinspan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-06T18:15:05Z","updated_at":"2018-03-08T17:26:55Z","closed_at":"2018-03-07T13:56:13Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/23412","html_url":"https://github.com/laravel/framework/pull/23412","diff_url":"https://github.com/laravel/framework/pull/23412.diff","patch_url":"https://github.com/laravel/framework/pull/23412.patch"},"body":"The `whereBetween` method on `\\Illuminate\\Database\\Query\\Builder` will attempt to bind parameters even when using `DB::raw(...)`.\r\n\r\nUsing tinker to illustrate this;\r\n```\r\n>>> DB::table('test')->whereBetween('a', [1, 4])->toSql()\r\n=> \"select * from `test` where `a` between ? and ?\"\r\n>>> DB::table('test')->whereBetween('a', [DB::raw('b'), DB::raw('c')])->toSql()\r\n=> \"select * from `test` where `a` between ? and ?\"\r\n>>> DB::table('test')->whereBetween('a', [DB::raw('b'), DB::raw('c')])->getBindings()\r\n=> [\r\n     Illuminate\\Database\\Query\\Expression {#1514},\r\n     Illuminate\\Database\\Query\\Expression {#1523},\r\n   ]\r\n```"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/371560141","html_url":"https://github.com/laravel/framework/pull/23412#issuecomment-371560141","issue_url":"https://api.github.com/repos/laravel/framework/issues/23412","id":371560141,"user":{"login":"mgrinspan","id":26468173,"avatar_url":"https://avatars1.githubusercontent.com/u/26468173?v=4","gravatar_id":"","url":"https://api.github.com/users/mgrinspan","html_url":"https://github.com/mgrinspan","followers_url":"https://api.github.com/users/mgrinspan/followers","following_url":"https://api.github.com/users/mgrinspan/following{/other_user}","gists_url":"https://api.github.com/users/mgrinspan/gists{/gist_id}","starred_url":"https://api.github.com/users/mgrinspan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgrinspan/subscriptions","organizations_url":"https://api.github.com/users/mgrinspan/orgs","repos_url":"https://api.github.com/users/mgrinspan/repos","events_url":"https://api.github.com/users/mgrinspan/events{/privacy}","received_events_url":"https://api.github.com/users/mgrinspan/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T17:26:55Z","updated_at":"2018-03-08T17:26:55Z","author_association":"NONE","body":"@taylorotwell please see above. (Sorry to nag, not sure if you would see this without a mention.)"}}
{"actor":{"display_login":"mgrinspan"}}