{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/15675","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/15675/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/15675/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/15675/events","html_url":"https://github.com/laravel/framework/issues/15675","id":180062344,"number":15675,"title":"paginate method generate wrong sql when pass in second parameter \"columns\" more values","user":{"login":"andreipasat","id":8336876,"avatar_url":"https://avatars.githubusercontent.com/u/8336876?v=3","gravatar_id":"","url":"https://api.github.com/users/andreipasat","html_url":"https://github.com/andreipasat","followers_url":"https://api.github.com/users/andreipasat/followers","following_url":"https://api.github.com/users/andreipasat/following{/other_user}","gists_url":"https://api.github.com/users/andreipasat/gists{/gist_id}","starred_url":"https://api.github.com/users/andreipasat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreipasat/subscriptions","organizations_url":"https://api.github.com/users/andreipasat/orgs","repos_url":"https://api.github.com/users/andreipasat/repos","events_url":"https://api.github.com/users/andreipasat/events{/privacy}","received_events_url":"https://api.github.com/users/andreipasat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/laravel/framework/labels/needs%20more%20info","name":"needs more info","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-29T14:18:53Z","updated_at":"2016-09-30T22:20:25Z","closed_at":null,"body":"- Laravel Version: 5.3.*\r\n- PHP Version: 7\r\n- Database Driver & Version: MySql\r\n\r\n### Description:\r\nHello !\r\nI try to get results form database and cunctruct pagination using query builder : \r\n`$profiles = DB::table('profiles')->select('profiles.*','profiles.id as profile_id');`\r\n`$results = $profiles->paginate(8, ['id','name']);`\r\n\r\nIn this case i get sql error like : \r\n\r\nSQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' `name`) as aggregate from `profiles` ' at line 1 (SQL: select count(`id`, `name`) as aggregate from `profiles` )\r\nIt's clear that error apears because of : count(`id`, `name`)\r\nI think should be generated count(`id`) as aggregate, `name` from profiles.\r\nThis is very disappointing becuase imagine that need to use having in sql, it's impossibile to use paginate for cases like that.\r\n\r\n\r\n### Steps To Reproduce:\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/250865716","html_url":"https://github.com/laravel/framework/issues/15675#issuecomment-250865716","issue_url":"https://api.github.com/repos/laravel/framework/issues/15675","id":250865716,"user":{"login":"themsaid","id":4332182,"avatar_url":"https://avatars.githubusercontent.com/u/4332182?v=3","gravatar_id":"","url":"https://api.github.com/users/themsaid","html_url":"https://github.com/themsaid","followers_url":"https://api.github.com/users/themsaid/followers","following_url":"https://api.github.com/users/themsaid/following{/other_user}","gists_url":"https://api.github.com/users/themsaid/gists{/gist_id}","starred_url":"https://api.github.com/users/themsaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themsaid/subscriptions","organizations_url":"https://api.github.com/users/themsaid/orgs","repos_url":"https://api.github.com/users/themsaid/repos","events_url":"https://api.github.com/users/themsaid/events{/privacy}","received_events_url":"https://api.github.com/users/themsaid/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T22:20:25Z","updated_at":"2016-09-30T22:20:25Z","body":"@andreipasat But the query should only return the count, that's why I wonder why you pass multiple columns."}}
{"actor":{"display_login":"themsaid"}}